Should IF-NOT and WHILE-NOT be put in the box


#1

Some people have said they find UNLESS to be counterintuitive, and actually prefer IF NOT.

As fitting with Rebol’s “say what you mean, how you mean it”…I go back and forth on this, and I don’t have a completely generic rule. Sometimes I like to say “if not”. Sometimes I like to say “unless”. It’s a contextual decision based on what I want to emphasize.

But we now have a situation where the behavior for equality means IF NOT is different from UNLESS, because there is a sensitivity to a “count” of operations on the left. UNLESS is one operation, IF NOT is two. They are not interchangeable in the mechanics.

This makes me wonder: should there be an IF-NOT? It would be a synonym for UNLESS and a single operation. As UNTIL is the Ren-C opposite of WHILE, you might argue that WHILE-NOT would be a parallel as well.

I sort-of regret-that we-have to-think about this kind of thing. But people always gripe about things until they get used to them. Rebol2/Red/R3-Alpha historically being able to do if x = 1 + 2 [...] but not if 1 + 2 = x was accepted, and it’s awkward until you got used to it…and the only people around to critique it further were the people who said that was ok:

I think the new rules are better over the long run. But ask, whether things like IF-NOT are useful in that world.


#2

Um, for clarity, in Alpha infix is left-reducing, so x = 1 + 2 doesn’t make any sense, and 1 + 2 = x does.


#3

If-not sounds like a good idea. It’s more symmetric with if.