Nu Class Reference
NuBlock
The Nu representation of functions.
Superclass: NSObject
Declared in: objc/block.h
In Nu programs, blocks may be directly created using the do operator. Since blocks are objects, they may be passed as method and function arguments and may be assigned to names. When a block is assigned to a name, the block will be called when a list is evaluated that contains that name at its head; the remainder of the list will be evaluated and passed to the block as the block's arguments.
Blocks are implicitly created by several other operators.
The Nu function operator uses blocks to create new named functions.
The Nu macro operator uses blocks to create macros. Since macros evaluate in their callers' contexts, no context information is kept for blocks used to create macros.
The imethod and cmethod operators use blocks to create new method implementations. When a block is called as a method implementation, its context includes the symbols self and super. This allows method implementations to send messages to the owning object and its superclass.
Methods
- - body
- - context
- - evalWithArguments:context:
- - evalWithArguments:context:self:
- - initWithParameters:body:context:
- - parameters
- - stringValue
| - | (NSMutableDictionary *) | context |
in objc/block.h
| - | (id) | evalWithArguments: | (id) cdr |
| context: | (NSMutableDictionary *) calling_context | ||
in objc/block.h
| - | (id) | evalWithArguments: | (id) cdr |
| context: | (NSMutableDictionary *) calling_context | ||
| self: | (id) object | ||
in objc/block.h
| - | (id) | initWithParameters: | (NuCell *) a |
| body: | (NuCell *) b | ||
| context: | (NSMutableDictionary *) c | ||
in objc/block.h