Originally, the THEN operation was proposed by @rgchris as acting like an “anti-ELSE”. While ELSE was reacting to the outcome of a conditional based on the null-ness (it was called voidness in those days, now VOID! is something different)… THEN would take the reverse view. If something was non-null, then it would run.
This didn’t completely gel, because THEN seemed to fit into cases of being an enfix form of IF. Remember that “back in those days”, a failed ALL was still returning BLANK!, the following sensible-seeming code would cause a problem:
all [ 1 > 2 3 > 4 ] then [ print "this would run due to BLANK! left hand side" ]
And that right there was one of the seeming best uses of THEN. So things were shuffled around, and THEN based its decision on the conditional truth or falsehood of the left hand side. The definition of then was actually just “infix IF”:
then: enfix :if
It felt a bit sad to have THEN and ELSE not “line up”. But the word ALSO was freed up and seemed like it could be ELSE’s complement.
It also felt a bit awkward to lack an anti-THEN. What would be the infix tester for conditional falseness on the left hand side, if it wasn’t ELSE?
But…wait! Things have changed!
Imagine we dial it back to where THEN is ELSE’s complement…driven by non-nullness instead of conditional truth.
The motivating case of ALL […] THEN […] is now taken care of. ALL doesn’t return blank on failure, it returns null. There’s never any other falsey output from it, so it need not be conditionally driven to get conditional behavior.
AND and OR have kept upping their game. If you need enfix logic detectors that run arbitrary code on their right hand side, you’ve got 'em. 1 < 2 and [print “This works, use a BLOCK! on the right vs. a GROUP!”]. (Remember, using a GROUP! on the right forces AND+OR to give back LOGIC!) Together these pretty much cover the puzzle of what to do about the left hand side being conditionally true or conditionally false.
It would be preferable if ALSO could take over today’s “SO” behavior. e.g. “Do this thing also, but don’t add to the result”. SO is kind of a short word, and @gchiu didn’t like it.
The “weird” issue is still that 1 > 2 then [print “this will run”]. Of course, 1 < 2 else [print “this has been how it is already”]. But this can be learned by thinking of THEN and ELSE as being more concerned with whether something happened or not, in the abstract vs. the truth of that thing.
Which I will talk more about in an upcoming post, which is more speculative about applications of THEN and ELSE. But this is a good and right change that needs to be done…now!