Exponentiation operator precedence
Kevin Smith
zenparsing at gmail.com
Thu Aug 27 14:04:29 UTC 2015
>
> x ** y ** z is easier to read/write than x.pow(y.pow(z))
>
That might be cherry picking. Trying to make up something a little more
complex:
a**b * -c**d + e
Math.pow(a, b) * -Math.pow(c, d) + e
a.pow(b) * -c.pow(d) + e
I don't have strong feelings on this issue, but the third option looks
pretty good to me. If we had some form of pipelining syntax (yet to be
proposed), then we could have:
let { pow } = Math;
a->pow(b) * -c->pow(d) + e;
Kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150827/1b4d9e22/attachment.html>
More information about the es-discuss
mailing list