
Symbols and Path Expressions
'symbolname
'). The quote suppresses the evaluation of the identifier (no variable lookup occurs). One use of symbols is as a way to provide distinct values. For instance:
x :To convert a string to a symbol, use the function='red; ... if x='red then ... else if x ='blue then ... else if x ='green then ...
Intern; to convert a symbol to a string, use the function SPrintObject. For instance:
Print(Intern("red"))
red
Print(SPrintObject('red))
"red"
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996