You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, it would be useful to reverse the operands of a binary operator. For example, to yank an expression and then use it as the lower bound of a Range:
(Ya+b),c
There is currently no way to save the parentheses, unless it's possible to rearrange the program so the yank happens first and then the expression is y,c.
If ~ were a meta-operator that swapped an operator's left and right operands, we could do
c,~Ya+b
potentially saving a byte.
TBD: What does the meta-operator do when applied to a ternary operator?
The text was updated successfully, but these errors were encountered:
Interesting thought! I can see how that would be useful sometimes. From a quick look at the code, it also appears that the easiest way to implement ~ would be to swap the first and second branches of the expression's parse tree before evaluating, which would indeed result in the rhs being evaluated first. I'll have to think some more about how that would work when combined with the : meta-operator, though.
Sometimes, it would be useful to reverse the operands of a binary operator. For example, to yank an expression and then use it as the lower bound of a Range:
There is currently no way to save the parentheses, unless it's possible to rearrange the program so the yank happens first and then the expression is
y,c
.If
~
were a meta-operator that swapped an operator's left and right operands, we could dopotentially saving a byte.
TBD: What does the meta-operator do when applied to a ternary operator?
The text was updated successfully, but these errors were encountered: