Was also going to note the "?" in "if?" didn't make sense, due to how it's used in rebol, before finding core has both "if" and "if?", and "if?" does indeed return a boolean. Since both are there though, that does make it unnecessary in this particular example.
However, there is one thing that could be done with "if": in arturo, it's documented to always return null, however in rebol it returns the value of the evaluated block, making "if/else" and "either" work as a ternary (and just "if" returns a none! if it was false).
Now, why the two "if"s:
Obviously, as you yourself mentioned, 'if? returns a boolean (the result of the condition) and 'if doesn't.
So that's one use.
The next use - which I will obviously have to make crystal clear in the Language Reference - is that if? (with the ?) is a must if you want to pair with an "else".
Think of it this way. If?-else may appear as a language construct, but in fact they are two separate commands. The if? is an if - that pushes the result of the condition of the stack. And "else" is actually a reversed-if: it checks what is at the top of the stack (see: returned by the if? above) and if that is false - that is: the above if-condition was not true - it executes its block.
So, in that case, you have to use an "if?" (and not a simple "if")
The same thing happens with a case/when? construct (only, in that case, the condition blocks are actually concatenated),e .g.
case [x] when? [<3] [print "it was less than 3"] when? [=3] [print "it was equal to 3"] else [ print "it was greater than 3"]
:)
:)
One idea would be to add an .attribute, e.g. if.get - and then have it return a value.
Or, use a different function altogether.
But then we'd have, 3-4 if's. That sounds like a bit of an overkill, I admit.
I'm absolutely open to ideas :)
So...
The command "if?" takes two arguments: a boolean and a block.
Think of it like if? <something> [do something-else].
In this example, something is `even? x` and something-else is `print [x "is even"]`.
And yes, regarding the right-arrow symbol you are absolutely correct: it's syntactic sugar for wrapping a command in a block (provided that it's just ONE command - if there are more than one, you will have to use a block).
But it's still syntactic sugar as ALL symbols being used in Arturo. Pretty much like ".." is the symbol infix-alias of the command "range".