Nu Class Reference

NuSymbol

The Nu symbol class.

Superclass: NSObject
Declared in: objc/Nu.h

Instances of NuSymbol are used to uniquely represent strings in parsed Nu expressions. NuSymbol objects are used as keys in local evaluation contexts (typically of type NSMutableDictionary) and each NuSymbol may also have a global value bound to it. Symbols ending in a colon (':') are considered "labels" which evaluate to themselves without error, and when a label is found at the head of the list, the list is considered to be a special type of list called a property list (no relation to ObjC plists). Each member of a property list is evaluated and the resulting list is returned with no further evaluation.

Methods

- (NSString *) description
Get a description of a symbol. This is equivalent to a call to stringValue.

in objc/Nu.h

- (NSComparisonResult) compare: (NuSymbol *) anotherSymbol
Compare a symbol with another symbol by name. This allows arrays of symbols to be easily sorted.

in objc/Nu.h

- (id) evalWithContext: (NSMutableDictionary *) context
Evaluate a symbol in a specified context.

in objc/Nu.h

- (NSString *) labelName
If a symbol is a label, get a string representing its name. This string omits the final colon (':').

in objc/Nu.h

- (bool) isGensym
Returns true if a symbol is to be replaced by a generated symbol (which only occurs during macro evaluation).

in objc/Nu.h

- (bool) isLabel
Returns true if a symbol is a label.

in objc/Nu.h

- (NSString *) stringValue
Get an object of type NSString representing the symbol.

in objc/Nu.h

- (void) setValue: (id) v
Set the global value of a symbol.

in objc/Nu.h

- (id) value
Get the global value of a symbol.

in objc/Nu.h