Vote: should UNSET act as a value?
As R3 moves toward finalization, we have some decisions to make.
VOTE NOW: Should the unset! value be ignored by certain control functions?
Note that unset! means "no value". For example, a variable that has not been assigned a value is unset or a function that calls exit returns unset.
For some functions, such as the logical control functions all and this question is important. For example, if we have a function:
test: func [a] [print a exit]
and it is used here:
if any [test 123] [print "ok"]
The test will return the unset, but how should any handle it?
There are three choices:
- The unset value is treated as a non-none value, so ok is printed.
- The unset value is ignored, so it's like any [], which returns false, and ok is not printed.
- Unset is not valid, and an error is thrown.
Please think about this relative to your experience and code you've written. What's the most practical result?
Vote for 1, 2, or 3 in the comment section.
27 Comments
|