Remove operator precedence #7

olofson opened this Issue Feb 15, 2014 · 0 comments


None yet
1 participant

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