-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make **
be right associative
#9684
Conversation
Can we add a spec to settle also the As of 0.35.1 |
Oh, that's totally unexpected for me, but I guess if most other programming languages, and even Google, work this way it makes sense to do it like that. |
I also find it confusing :-). Even if we choose to leave as it is and behave differently from others a spec will settle the choice at least. |
I don't know how to make it work :'-( |
Feel free to try to make it work. It's already tricky as it is, but it's even more tricky with things like Maybe we can leave things as they are now, but document them well. |
Unary minus has a higher precedence than exponentiation in crystal. So it is expected I think associativity of exponentiation and precedence of unary minus are separate problems. |
Yes, I think they are separate problems too. Should we merge this and tackle the other problem later if needed? |
Ok, sure. |
@asterite I'm reopening this. I think we can merge this and change the Yet, I think the pr and code should be named right associative 🙈 . Left associative is what we have now. Do you want to do the rename or should I? |
e226c3c
to
117c7df
Compare
Oops! 😄 |
Ready for another review... I can't change the branch name, though :-P |
117c7df
to
c16ed77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
FYI, I continued the discussion of unary negation in the forum thread.
For https://forum.crystal-lang.org/t/exponentiation-operator-has-unexpected-behaviour/2457
I think it would be better if the associativity is the same as most major languages out there. And we better do this change before 1.0