Null object: Difference between revisions
Latitude language added
(Add Jsish) |
Mercerenies (talk | contribs) (Latitude language added) |
||
Line 832:
#y->type == 'null'
//true</lang>
=={{header|Latitude}}==
Nil is an object in Latitude, like any other.
<lang latitude>foo := Nil.
if { foo nil?. } then {
putln: "Foo is nil".
} else {
putln: "Foo is not nil".
}.</lang>
In particular, Nil satisfies the Collection mixin, so it can be treated as an (immutable) collection.
<lang latitude>Nil to (Array). ;; []</lang>
Nil is the default value returned if a method body is empty.
<lang latitude>func := {}.
func. ;; Nil</lang>
=={{header|Lingo}}==
|