Null object: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 44:
COMMENT using the UNESCO/IFIP/WG2.1 ALGOL 68 character set
result := °;
IF REF STRING(result) :?: ° THEN print(("result ? °", new line)) FI;
END COMMENT
 
Line 201:
=={{header|Haskell}}==
 
Haskell does not have a universal null value. There is a 'value of every type', the undefined value (sometimes written ?, 'bottom'), but it is essentially a sort of exception — any attempt to use it is an error.
 
<lang haskell>undefined -- undefined value provided by the standard library
Line 513:
if ![info exists arr(nullval)] ...
if ![dict exists $dic nullval] ...</lang>
You can algo use this condition inside an if statement to check if the variable $value is set or not:
<lang Tcl>[expr {([string compare "$value[puts \"\"]" ""]==1)}]</lang>
I think this is the better way to achieve it. In this case, if $value is set, returns true, or else returns false.
 
{{omit from|TI-83 BASIC}} {{omit from|TI-89 BASIC}} <!-- Does not have a null value. -->
Anonymous user