Null object: Difference between revisions

added Fantom example
(→‎{{header|Go}}: reference Undefined values task)
(added Fantom example)
Line 191:
=={{header|Factor}}==
<lang factor>: is-f? ( obj -- ? ) f = ;</lang>
 
=={{header|Fantom}}==
 
Test for equality with 'null', which is the null value.
 
<lang fantom>
fansh> x := null
fansh> x == null
true
fansh> x = 1
1
fansh> x == null
false
</lang>
 
Note, nullable objects have a type ending in a question mark, for example:
 
<code>Int? y := null</code> is valid, but
 
<code>Int y := null</code> is not.
 
=={{header|Forth}}==
342

edits