Null object: Difference between revisions

Content added Content deleted
(Added EchoLisp)
Line 852: Line 852:


=={{header|ooRexx}}==
=={{header|ooRexx}}==
ooRexx has a special singleton object call .nil that is used to indicate the absence of values in some situations (such as the default values returned from collection objects).
ooRexx has a special singleton object called .nil that is used to indicate the absence of values in some situations (such as the default values returned from collection objects).
<lang ooRexx>
<lang ooRexx>
if a[i] == .nil then say "Item" i "is missing"
if a[i] == .nil then say "Item" i "is missing"
Line 863: Line 863:
if \var("var") then say "Variable" var "is not assigned"</lang>
if \var("var") then say "Variable" var "is not assigned"</lang>
Output:
Output:
<pre>Item 3 of array A is missing
<pre>
Item 3 of array A is missing
Variable INPUT is not assigned
Variable INPUT is not assigned
Variable VAR is not assigned
Variable VAR is not assigned</pre>
</pre>


=={{header|Oz}}==
=={{header|Oz}}==