Exponentiation operator precedence
thomasjamesfoster at bigpond.com
Tue Aug 25 16:16:46 UTC 2015
This may be of some relevance: https://en.wikipedia.org/wiki/Order_of_operations#Special_cases
> On 26 Aug 2015, at 1:49 AM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
>> On Aug 25, 2015, at 8:11 AM, Mark S. Miller wrote:
>> I think we should drop the feature. Given the conflict between
>> * the history of ** in other languages,
>> * the general pattern that unary binds tighter than binary
>> any solution at this point will confuse many people. These confusions will not result in a confusing static rejection but in runtime behavior that *sometimes* violates expectations. I was all for adding ** to the language when it did not have these problems. But it does. The minor convenience it adds is not worth these costs. By contrast, no one is confused about the parsing of calls to Math.pow.
>> When in doubt, leave it out.
> I've had the same reaction to this recent thread. It seems like the functional form (Math.pow) is a much less confusing formulation for use in JS expressions.
> It's interesting to note that while early "algebraic languages" such as FORTRAN, Algol 60, BASIC, PL/I all had exponentiation operators the next couple generations of similar languages including Pascal, C, C++, Java, and C# do not. Each of those languages could have had an exponentiation operator but choose to exclude it.
> The utility of an exponentiation operation may simply not be worth the complexity and potential for confusion it introduces into a language with a rich set of operators.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss