EpilogJS
What
versus
How
 

symbolp


symbolp(expression) → boolean

The subroutine constantp takes an expression as argument and determines whether or not it is a symbol. If the specified expression is a symbol, symbolp returns true>; otherwise, it returns false.

Call: symbolp('a23') Exit: true Call: symbolp('1989') Exit: true Call: symbolp('3.14159') Exit: true Call: symbolp('barack_obama') Exit: true Call: symbolp('person.father') Exit: true Call: symbolp('X23') Exit: true Call: symbolp('_') Exit: true Call: symbolp('"The quick from fox & the lazy dog!"') Exit: true Call: symbolp(['f','a','b']) Exit: false

A symbol is a string of alphanumeric characters and underscores and periods beginning with a letter or a digit or an underscore or it is a string of printable ascii characters enclosed in double quotes. Note that, in the current reader, there is no way of escaping double quotes in quoted strings. Note also that it is common practice not to use upper case letters in symbols except as the first character. (This is to allow interoperation to implementations that are case-independent and, therefore, do not distinguish upper and lower case letters).




Comments and complaints to genesereth@stanford.edu.