Null object: Difference between revisions

m
 
Line 486:
=={{header|Chapel}}==
 
Class variables can be declared as nil if and only if they have nilable class type, declared with postfix ?, alongside memory management technique owned, borrowed, shared, or unmanaged. A nilable class type is default initialized to nil.
Objects variables without an initializer expression will be initiallized to nil:
<syntaxhighlight lang="chapel">class C { };
class C { };
var c : owned C?; // is nil
writeln(if c == nil then "nil" else "something");</syntaxhighlight>
</syntaxhighlight>
 
=={{header|Clojure}}==
6

edits