Skip to content
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

Remove operator precedence #7

olofson opened this issue Feb 15, 2014 · 0 comments

Remove operator precedence #7

olofson opened this issue Feb 15, 2014 · 0 comments


Copy link

@olofson olofson commented Feb 15, 2014

This may sound like a really rather drastic and odd thing to do, but EEL wouldn't be the only language to not have operator precedence. (Closest relative: The Audiality 2 scripting language.) Operator precedence is pointless outside of traditional math (where everyone knows the precedence of the few operators there are), and just offers another way of generating annoying, non-obvious bugs.

Note that since EEL has "Pascal style" assignment operators (that is, assignment operators don't generate results), there would actually still be two levels: assignment operators would have lower priority than all other operators. (Otherwise, you'd need parentheses around the expression in every single assignment statement that involves other operators, which is just nonsensical, I think.)

This will of course break code that relies on operator precedence, so we should probably throw in a switch that issues warnings whenever an expression would evaluate differently with/without operator precedence. Just add parentheses in the cases the difference is intended, and then you're done - script converted!

And of course, if we're making the switch, it's probably better to do it right now, before we have more than about three active EEL coders. ;-)

@olofson olofson added this to the 0.3.7 milestone Feb 15, 2014
@olofson olofson added the enhancement label Feb 15, 2014
@olofson olofson closed this in 6a8e12c Feb 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.