Null object: Difference between revisions
m
→{{header|Chapel}}
Langurmonkey (talk | contribs) |
LalaithMeren (talk | contribs) |
||
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.
<syntaxhighlight lang="chapel">
class C { };
var c : owned C?; // is nil
writeln(if c == nil then "nil" else "something");
</syntaxhighlight>
=={{header|Clojure}}==
|