3.2.53. SYMBOL(name)

Checks if the string name is a valid symbol (a positive number or
a possible variable name), and returns a three letter string
indicating the result of that check.  If name is a symbol, and
names a currently set variable, VAR is returned, if name is a
legal symbol name, but has not a been given a value (or is a
constant symbol, which can not be used as a variable name), LIT is
returned to signify that it is a literal.  Else, if name is not a
legal symbol name the string BAD is returned.

Watch out for the effect of “double expansion”. Name is
interpreted as an expression evaluating naming the symbol to be
checked, so you might have to quote the parameter.

     SYMBOL(‘Foobar’)         –>   ‘VAR’  /* Maybe */
     SYMBOL(‘Foo bar’)        –>   ‘BAD’
     SYMBOL(‘Foo.Foo bar’)    –>   ‘VAR’     /* Maybe */
     SYMBOL(‘3.14’)      –>   ‘LIT’
     SYMBOL(‘.Foo->bar’) –>   ‘BAD’



PREV NEXT