Inverse Parentheses
11–20 of 67 posts
Re: Inverse Parentheses
#12I love the twist: reversing the friendly levels gives you a classic parser, and it opens up crazy experiments like whitespace weakening. Have you tested it on non-arithmetic ops (logical/bitwise) or more complex expressions like ((()))?
Re: Inverse Parentheses
#13I was hoping the parentheses themselves would be flipped. Like this: > 1 + )2 * 3( (1 + 2) * 3
Re: Inverse Parentheses
#14Re: Inverse Parentheses
#15Re: Inverse Parentheses
#16Using Brave on MacOS, I cannot scroll the page to see the entire text. On Firefox, it scrolls fine.
Well done.
Re: Inverse Parentheses
#17Re: Inverse Parentheses
#18Am I stupid if I don't get it? What is the intended end state? What does "ungroup operands" mean?
Re: Inverse Parentheses
#19Re: Inverse Parentheses
#20If you have the expression 1+2*3 you have three elements with two operands. You need to choose a rule to pick one of them first.
In mathematics, the rule is "*/ then +-" and then from left to right. This means that usually first you do 2*3, then 1+.
But what if you do want to make 1+2 first?
There is another alternative, parenthesis. Those mean "do the thing inside first" so (1+2)*3 changes the precedence and now you do 1+2 first, then *3
The post is asking: with parenthesis you can increase the precedence of operations. What if you could decrease it?
Let's use «» as another operand (the blog uses parenthesis, but that makes it really confusing) this operand means "do the thing inside last". So the expression 1+«2*3» means "do 1+ first, then 2*3.
The issue is...this doesn't make sense, what the blog is really saying is to reduce the precedence of operators. Think the expression 1+2«*»3 or 1+2(*)3 and now the rule is "the parenthesized operators have one precedence less" so 1+2(*)3=(1+2)*3