logoalt Hacker News

MrMcCall12/09/20241 replyview on HN

The same operators don't need precedence rules; each language is processed left-to-right or vice versa. Usually it's left-to-right, in my experience with maybe a dozen languages professionally, maybe twice that in exploration.


Replies

FabHK12/11/2024

With the same operator, the rule is not called precedence, but associativity (left or right; consider 2^3^4 where it matters), but you still need a rule - unless you use parentheses, which you said you always do.

show 1 reply