Last updated at 10:19 am UTC on 10 March 2016
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.
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.
Some common instance methods (Check the Class for more)
- isInfix, isKeyword, isLiteral, isPvtSelector, isUnary
- asString, asSymbol, capitalized
Common class methods
- Instance creation
- intern:, internCharacter:, lookup:
- selectorsContaining: (e.g., Symbol selectorsContaining: 'at')
Class Symbol examples