3 ms·
Because parsing "a += b * c" as "(a += b) * c" is a wonderful, intuitive program. (This does assume that op= is an expression in your language.)
by jcranmer 6y ago
Because parsing "a += b * c" as "(a += b) * c" is a wonderful, intuitive program.
(This does assume that op= is an expression in your language.)
- phkahler 6y agoIncluding precedence rules will take care of that.
- masklinn 6y agoThat… would be jcranmer's point, they're replying to a toplevel comment advocating for not having precedence.
- sreekotay 6y agoEdit: Realized what I was tring to say: Intuitive might be the wrong thing to chase. Intuitive to who? :) Trivial programs are trivial. We might be stuck in the BCPL derived syntax that trade a false notion of intuitive for complexity of implentation and maintenance. (And I do mean might --- it's not hard not to think incrementally from the languages we know) --- but "inituitive" is EXACTLY the problem: I guess I was arguing we might consider searching for simple and predictable (even if that comes at the cost of slightly higher initial learning?)
- sreekotay 6y agoe.g. maybe write it as "b * c += a" ? ... lol full on LR - no ambiguiity.