REBOL 3.0

Vote: should UNSET act as a value?

Carl Sassenrath, CTO
REBOL Technologies
27-May-2009 20:29 GMT

Article #0207
Main page || Index || Prior Article [0206] || Next Article [0208] || 27 Comments || Send feedback

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:

  1. The unset value is treated as a non-none value, so ok is printed.
  2. The unset value is ignored, so it's like any [], which returns false, and ok is not printed.
  3. 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

REBOL 3.0
Updated 20-Nov-2024 - Edit - Copyright REBOL Technologies - REBOL.net