Null object: Difference between revisions

→‎Icon and Unicon: combined headers
(BASIC)
(→‎Icon and Unicon: combined headers)
Line 273:
Just v -> "It's not Nothing; it is " ++ show v ++ "."</lang>
 
== {{header|Icon}} and {{header|Unicon }}==
Icon/Unicon have a [[Icon%2BUnicon/Intro#null|null value/datatype]]. It isn't possible to undefine a variable.
 
==={{header|Icon}}===
<lang Icon>procedure main()
nulltest("a",a) # unassigned variables are null by default
Line 287 ⟶ 286:
return write(name, if /var then " is" else " is not"," null.")
end</lang>
==={{header|Unicon}}===
This Icon solution works in Unicon.
 
=={{header|Io}}==
Anonymous user