Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Symbol
Last updated at 11:58 pm UTC on 15 October 2003
The class Symbol is a subclass of String. It represents unmutable strings, strings that are created uniquely. Symbols are identity objects. If two symbols are equal they are the same object.
Thus,
 someString asSymbol == someString asSymbol.

The literal representation of Symbols are a sequence of characters preceded by a number sign (#; aka pound sign). See symbol literal.
 #hello

Some common instance methods (Check the Class for more)


Common class methods


Example

Defining:
 a := 'hello'.
 b := 'hel', 'lo'.

evaluating
 a = b 
gives
 true

evaluating
 a == b 
gives
 false

evaluating
 a asSymbol == b asSymbol
gives
 true