Re: Exponentiation operator precedence

2015-08-26 Thread Jason Orendorff
On Wed, Aug 26, 2015 at 1:03 PM, Thomas thomasjamesfos...@bigpond.com wrote: There's still the issue of exponentiation being right-associative. Unless ** becomes an operator which behaves differently as to how it would in a high school maths class, we're at an impasse. I'm not sure I follow.

Re: Exponentiation operator precedence

2015-08-26 Thread Jason Orendorff
On Wed, Aug 26, 2015 at 11:09 AM, Mark S. Miller erig...@google.com wrote: I don't get it. The conflict between * the history of ** in other languages, * the general pattern that unary binds tighter than binary seems unresolvable. By the first bullet, -2 ** 2 would be -4. By the second, it

Re: Is the informative definition of [[Enumerate]] buggy?

2015-08-26 Thread Allen Wirfs-Brock
On Aug 26, 2015, at 11:03 AM, Raul-Sebastian Mihăilă wrote: In 9.1.11. it's specified that the iterator returned by the [[Enumerate]] method iterates over String-valued keys. But the informative definition at the end of 9.1.11. is based on whatever is returned by calling Reflect.enumerate

Re: Exponentiation operator precedence

2015-08-26 Thread Allen Wirfs-Brock
On Aug 26, 2015, at 9:09 AM, Mark S. Miller wrote: I don't get it. The conflict between * the history of ** in other languages, * the general pattern that unary binds tighter than binary seems unresolvable. By the first bullet, -2 ** 2 would be -4. By the second, it would be 4. Either

Re: Directed rounding

2015-08-26 Thread C. Scott Ananian
I think the better idea would be related to value types ( http://www.slideshare.net/BrendanEich/value-objects2) which brendan is working on for ES7. I fuzzily recall rounding modes being used as an example in one of these slide decks, perhaps I am misremembering. At any rate, one option would be

Re: Exponentiation operator precedence

2015-08-26 Thread Jason Orendorff
On Tue, Aug 25, 2015 at 5:43 PM, Mark S. Miller erig...@google.com wrote: When the costs were minor, it was ok that the benefits were minor. The costs will probably still be minor if we just let Rick look at it and revise the proposal. What has happened here is - upon implementing the feature,

Re: Exponentiation operator precedence

2015-08-26 Thread Brendan Eich
Yehuda Katz cited an acronym taught when he was a wee lad learning algebra: PEMDAS (Parentheses, Exponentiation, Multiplication/Dviistion, Addition/Subtraction). Who else learned this? There's nothing sacrosanct about binary precedence being generally lower than unary. Consider the property

Re: Exponentiation operator precedence

2015-08-26 Thread Mark S. Miller
I don't get it. The conflict between * the history of ** in other languages, * the general pattern that unary binds tighter than binary seems unresolvable. By the first bullet, -2 ** 2 would be -4. By the second, it would be 4. Either answer will surprise too many programmers. By contrast, no

Is the informative definition of [[Enumerate]] buggy?

2015-08-26 Thread Raul-Sebastian Mihăilă
In 9.1.11. it's specified that the iterator returned by the [[Enumerate]] method iterates over String-valued keys. But the informative definition at the end of 9.1.11. is based on whatever is returned by calling Reflect.enumerate on the prototype of the current object, assuming that there is such

Re: Exponentiation operator precedence

2015-08-26 Thread Thomas
There's still the issue of exponentiation being right-associative. Unless ** becomes an operator which behaves differently as to how it would in a high school maths class, we're at an impasse. That said, ^ is usually the operator used for exponentiation outside programming languages when you

Re: Exponentiation operator precedence

2015-08-26 Thread Alexander Jones
Exponentiation is written in conventional mathematics as if it were a postfix unary operator, parameterised by a value written in superscript. IMO this puts it in a whole different class to binary operators where both operands are written equally. I don't see a ** b ** c as a good reflection of

Re: Directed rounding

2015-08-26 Thread Waldemar Horwat
On 08/26/2015 13:12, C. Scott Ananian wrote: I think the better idea would be related to value types (http://www.slideshare.net/BrendanEich/value-objects2) which brendan is working on for ES7. I fuzzily recall rounding modes being used as an example in one of these slide decks, perhaps I am

Assignment of global variables deleted by their RHS in strict mode

2015-08-26 Thread Kevin Gibbons
See the following test262 test: https://github.com/tc39/test262/blob/master/test/language/expressions/assignment/S11.13.1_A5_T5.js (and related tests with update / compound assignment). In short, it is possible to have a Reference to a global variable which has been deleted. Normally, bare

Re: Assignment of global variables deleted by their RHS in strict mode

2015-08-26 Thread Kevin Gibbons
Filed at https://bugs.ecmascript.org/show_bug.cgi?id=4532 On Wed, Aug 26, 2015 at 3:17 PM, Mark S. Miller erig...@google.com wrote: On Wed, Aug 26, 2015 at 2:55 PM, Kevin Gibbons ke...@shapesecurity.com wrote: See the following test262 test:

Re: Exponentiation operator precedence

2015-08-26 Thread Mark S. Miller
On Wed, Aug 26, 2015 at 2:55 PM, Waldemar Horwat walde...@google.com wrote: On 08/26/2015 09:09, Mark S. Miller wrote: I don't get it. The conflict between * the history of ** in other languages, * the general pattern that unary binds tighter than binary seems unresolvable. By the first

Re: Exponentiation operator precedence

2015-08-26 Thread Waldemar Horwat
On 08/26/2015 09:09, Mark S. Miller wrote: I don't get it. The conflict between * the history of ** in other languages, * the general pattern that unary binds tighter than binary seems unresolvable. By the first bullet, -2 ** 2 would be -4. By the second, it would be 4. Either answer will

Re: Exponentiation operator precedence

2015-08-26 Thread Bergi
Alexander Jones schrieb: Exponentiation is written in conventional mathematics as if it were a postfix unary operator, parameterised by a value written in superscript. IMO this puts it in a whole different class to binary operators where both operands are written equally. I don't see a ** b ** c

Re: Assignment of global variables deleted by their RHS in strict mode

2015-08-26 Thread Mark S. Miller
On Wed, Aug 26, 2015 at 2:55 PM, Kevin Gibbons ke...@shapesecurity.com wrote: See the following test262 test: https://github.com/tc39/test262/blob/master/test/language/expressions/assignment/S11.13.1_A5_T5.js (and related tests with update / compound assignment). In short, it is possible to

Re: Exponentiation operator precedence

2015-08-26 Thread Claude Pache
Le 26 août 2015 à 00:43, Mark S. Miller erig...@google.com a écrit : When the costs were minor, it was ok that the benefits were minor. Given significant costs, we need to ask: While I don't have a strong opinion about the cost of the proposed modified grammar, I protest that the cost

Re: Exponentiation operator precedence

2015-08-26 Thread Mark S. Miller
I completely agree. My When the costs were minor refers to when we were not yet aware of the conflict. On Wed, Aug 26, 2015 at 12:19 AM, Claude Pache claude.pa...@gmail.com wrote: Le 26 août 2015 à 00:43, Mark S. Miller erig...@google.com a écrit : When the costs were minor, it was ok that

Directed rounding

2015-08-26 Thread Martin von Gagern
Hello! Would you consider providing intrinsic functions for directed rounding, to encapsulate the corresponding features of IEE 754 floating point computations (resp. the fesetround function of C99)? That would be useful for mathematical applications, in particular when implementing interval

Re: Directed rounding

2015-08-26 Thread C. Scott Ananian
`fesetround` would be a terrible way for JavaScript to implement this, as it would allow a piece of code to affect the behavior of completely unrelated pieces of code by screwing with global rounding mode bits. That's not going to happen. I believe there have been proposals to allow greater

Re: Cancelable promises proposal

2015-08-26 Thread Boris Zbarsky
On 8/3/15 8:15 PM, Glen Huang wrote: Ideally, if the same resolve reject callback combination is passed more than once, the same promise is always returned That's a backwards-incompatible change from what browsers are shipping, right? (I can't think of a use case where promises could

Re: Assignment of global variables deleted by their RHS in strict mode

2015-08-26 Thread Allen Wirfs-Brock
On Aug 26, 2015, at 3:17 PM, Mark S. Miller wrote: On Wed, Aug 26, 2015 at 2:55 PM, Kevin Gibbons ke...@shapesecurity.com wrote: See the following test262 test: https://github.com/tc39/test262/blob/master/test/language/expressions/assignment/S11.13.1_A5_T5.js (and related tests with

Re: Exponentiation operator precedence

2015-08-26 Thread Waldemar Horwat
On 08/26/2015 15:08, Mark S. Miller wrote: The force of that precedent is indeed what my objection is. The yield counter-example is interesting, but yield is an identifier not an operator symbol, and so does not as clearly fall within or shape operator expectations. If someone explains a

Re: Exponentiation operator precedence

2015-08-26 Thread Isiah Meadows
Not much, as far as I can tell. Engines do usually lower this, and redo the whole object when the shape changes, or an intrinsic no longer applies. V8 has a MathPow intrinsic, and I believe SpiderMonkey has similar. On Wed, Aug 26, 2015, 23:45 Jordan Harband ljh...@gmail.com wrote: Is there

Re: Cancelable promises proposal

2015-08-26 Thread C. Scott Ananian
IMO promises should reject if they are cancelled. The same method that gave you the Promise (for example, an AJAX API) can give you a capability to cancel the Promise, ie cancel the pending network operation and reject the Promise (rejecting is a no-op if the operation races with cancellation and

Re: Exponentiation operator precedence

2015-08-26 Thread Mark S. Miller
On Wed, Aug 26, 2015 at 6:19 PM, Waldemar Horwat walde...@google.com wrote: On 08/26/2015 15:08, Mark S. Miller wrote: The force of that precedent is indeed what my objection is. The yield counter-example is interesting, but yield is an identifier not an operator symbol, and so does not as

Re: Exponentiation operator precedence

2015-08-26 Thread Jordan Harband
Is there also perhaps a potential performance/static analysis benefit in having it be syntax, rather than a builtin function? `Math.pow` can be overwritten, and varies per-realm, but `**` can not and does not. On Wed, Aug 26, 2015 at 8:21 PM, Mark S. Miller erig...@google.com wrote: On Wed,