Skip to Content Java Solaris Communities Partners My Sun Sun Store United States Worldwide

»  Spotlight Articles
»  Projects
»  Publications
»  People
»  Awards
»  Events
»  Downloads
»  Internships
»  Contrarian Minds
»  About Sun Labs

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.

[ Previous ] [ Index ] [ Next ]
Would you recommend this Sun site to a friend or colleague?
Contact About Sun News Employment Privacy Terms of Use Trademarks Copyright 1994-2008 Sun Microsystems, Inc.