Nil, true and false
- Assignable data slots in a new object are set to nil if not otherwise initialized.
- All inherit from mixins oddball, which defines copy to return self.
- Names are not special; just slots in globals.
|
Nil, true and false
These are one-of-a-kind objects, which are in some way special to the Virtual
Machine.
When an object is created using a literal object expression, assignable data slots
with no specified initial value are set to nil.
Nil inherits from traits oddball, which in turn inherits from mixins oddball, which
defines copy to return self.
True and false both inherit from traits boolean, but each has quite a lot of object-
specific behavior (for boolean logic, conditional evaluation, and so on). Traits
boolean also inherits ultimately from mixins oddball.
True and false are special in that they are the results of the relational primitives
(_IntLE:, _FloatGT:, etc.).
Note that unlike Smalltalk, the names nil, true and false are not special - they are
just slots in globals.
Note to Smalltalk programmers: the logical connectives are && and ||. Both send
value to their argument, so can be passed a block.
|