Null object: Difference between revisions

Content added Content deleted
(Lingo added)
Line 746: Line 746:


=={{header|Lingo}}==
=={{header|Lingo}}==
Null/nil is called "<Void>" in Lingo. Lingo doesn't distinguish undefined variables from <Void> objects, and by using the constant VOID you can even assign <Void> to variables. Functions that don't return anything, return <Void>. Checking for <Void> (e.g. by using built-in function voidP) can also be used to implement optional function arguments: if voidP() returns TRUE (1) for some argument, a default value can be assigned in the function body.
Null/nil is called "<Void>" in Lingo. Lingo doesn't distinguish undefined variables from <Void> objects, and by using the constant VOID you can even assign <Void> to variables. Functions that don't return anything, return <Void>. Checking for <Void> (e.g. by using built-in function voidP) can be used to implement optional function arguments: if voidP() returns TRUE (1) for some argument, a default value can be assigned in the function body.
<lang lingo>put _global.doesNotExist
<lang lingo>put _global.doesNotExist
-- <Void>
-- <Void>