TheNilObject
Last edit August 28, 2007
In the
SmalltalkLanguage
, "nil" is used to represent "no object."
It is...
A global symbol that references a unique object that represents "no object."
The "nil" instance is unique --
SingletonPattern
.
The "nil" object is an instance of the class
UndefinedObject
. So, if you send it messages that are defined on the
UndefinedObject
class, it will respond accordingly.
Returns
true
for the "isNil" message. (All other classes return
false.
)
Class Object defines an "isNil" method that answers (returns)
false.
UndefinedObject
defined an "isNil" method that answers
true.
See also
WhatIsNull
,
TheNilObjectInStronglyTypedLanguages
CategoryNull