NONE Is Back! (as Ren-C's *Truthy* Nothing State)

>> none
== \~[]~\  ; antiform (splice!) "none"

>> envelop [[]] none
== [[]]

So NONE is Just What We Call An Empty SPLICE!

This is useful when you want to get a "friendlier" result than void, e.g. one that can be used as a parse rule.

>> parse "aacc" [
       (rule: either 1 = 1 '[some "a"] [none])
       rule
       (rule: any [if 1 = 2 '[some "b"] none])
       rule
       some "c"
   ]
== "c"

If you used plain IF then that would unset RULE and it would be an error. But NONE is treated as a friendly no-op.

Note this aspect of NONE actually comes full-circle to Rebol2's interpretation:

rebol2>> rule: none
== none

rebol2>> parse [a] ['a rule]
== true

If you want falseyness in Ren-C, you use NULL...but that falseyness comes with an assumption that it is "more unintentionally empty". e.g. it's a variable you didn't assign yet BUT want to be able to test easily for truthiness/falseyness to know you haven't set it. Hence its behavior in cases like this would be too risky to assume you "just knew" it was supposed to be skipped. NONE fills the gap!

NONE's Name Is Close To NULL, But That May Be An Asset

Historically I considered it a bit unsetting to have two 4-letter words that start with "N" with close semantic meaning.

But there's something to it when you consider NONE as characterizing a collection (which it sounds like it does) while NULL is not.

NONE can say "I am a collection of things, so I am a thing."

Someone can ask: "How many things are in your collection."

NONE can say "There are none, clearly. But I exist in concept space in a way NULL does not. Hence I am truthy, and it's okay to (for instance) append me to things."

It's learnable, and the console feedback helps reinforce "hey that's a SPLICE!" so you get the sense that NONE has the properties of a splice.

A post was split to a new topic: COND vs. OPT / Opting Out vs. Opting In w/Nothing

A post was merged into an existing topic: COND vs. OPT — Opting Out vs. Opting In w/Nothing