As isotope design became refined, I became very pleased with the choice for what unset variables hold being the antiform blank.
>> x: ~ ; evaluating quasiform blank gives antiform blank (no console display)
>> unset? $x
== ~true~ ; anti
The alternative of using the antiform word! ~unset~
was available. But antiform blanks are a particularly pleasing choice, due to their succinct representation...which helps assigned variables stand out better in lists of mostly-unset variables. And it's hard to think of what antiform blanks would mean if they were not the unset state!
Also, if ~unset~ were used then people would probably expect unset? ~unset~ to be true. But I've held pretty strongly to my general terminology:
"There is no such thing as an 'unset value'. But variables can be considered unset...when they hold a value that is an antiform blank."
I'm pleased with this and have almost no complaints.
The problem is that ANTIFORM-BLANK is a mouthful. It needed a short name.
JavaScript Don't Care
JavaScript went with the idea that unset variables hold "undefined", and you can test for it using the typeof operator to subvert the error that is raised on access for variables that are never declared (what we might think of as unbound):
>> typeof asdf == 'undefined'
<- true
But if you define a variable, then it will retrieve the undefined state without error:
>> let jkl
<- undefined
>> jkl
<- undefined
Whatever. Point is, they don't have any crisis of conscience on whether "variables are undefined, not values". They just go with it, as historical Redbol did with UNSET!.
But I don't like it.
NOTHING Came To Seem The Best Option
For a while I thought I was settled on calling it "trash". I suggested it way back when the unset state was being changed away from being called VOID.
But then I realized that this was a much better name for QUASIFORM-BLANK (the tilde) than it was for the ANTIFORM-BLANK.
This led me to realize that NOTHING was the right answer.
-
TRASH evaluates to NOTHING ("when you take out the trash, you're left with nothing")
-
A variable that is unset holds NOTHING
-
META of NOTHING is TRASH
-
If a function evaluates to NOTHING, the Console has nothing to display
I had some initial reluctance about verbose names:
foo: func [
return: [nothing?]
bar [block!]
][
append bar [a b c]
return nothing
]
But there's a reasonable answer in the modern type checking world for these cases which is semiotically consistent... use a tilde (trash). The type spec accepts it (and assumes you mean an antiform), and RETURN will accept it (where the evaluator will turn the quasiform into an antiform):
foo: func [
return: [~]
bar [block!]
][
append bar [a b c]
return ~
]
As it happens, the default return result from functions is nothing. I've also proposed it might be good to make the assumption that a function without a RETURN: spec is a procedure with no return result (as opposed to an unconstrained result).
foo: func [
bar [block!]
][
append bar [a b c]
]
You can still say return ~
or return nothing
if you want in such functions if you want to return early.