Hacker News new | past | comments | ask | show | jobs | submit login

But they shouldn't bind a^b^c to (a^b)^c without parentheses.



That's exactly the difference between binding to the right and binding to the left (aka left-associativity and right-associativity). A left-associative exponent will parse to `(a^b)^c`, a right-associative one will parse to `a^(b^c)`


What I was trying to say is that parsing exponents like that makes as much sense as parsing a+b* 2 to (a+b)* 2.


No, it makes as much sense as parsing a* b* 2 to (a* b)* 2.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: