NoValue

NoValue is a special literal; it does not have a type and is convertible to all types. Any computation with NoValue , other than comparison with NoValue , will return NoValue .

NoValue is used in circumstances where a value is needed that cannot possibly be an expected result.

For example:

Intent>position(1,{3,4,5,1})
--> 4
Intent>position(1,{3,4,5})
--> NoValue
Intent>

NoValue is a legal value. However, with the exception of the "=" operator and a few functions, NoValue "contaminates" any calculation or expression that includes it, such that the result of the calculation is itself NoValue :

Intent>3+NoValue
--> NoValue
Intent>

Note that this does not result in an error. However, some functions will raise an error if you pass in NoValue .

There are exceptional cases where NoValue is allowed, and does not contaminate the result. Most importantly, you can test for NoValue using the ordinary "=" operator and get a Boolean result. For example, "if (foo = NoValue) then..." will not return NoValue merely for referencing NoValue in the equality test.