Re: Improving Function.prototype.bind

2012-01-09 Thread Andrea Giammarchi
I would be more than happy to go on with libraries first approach as long as we don't have to wait 6 years before a needed feature is going to be considered. I have also raised the problem because it is in my opinion underestimated but mainly because I would like to avoid the fragmentation of

Re: Improving Function.prototype.bind

2012-01-09 Thread David Bruant
Le 09/01/2012 06:29, Brendan Eich a écrit : On Jan 8, 2012, at 7:20 PM, John J Barton wrote: On Sun, Jan 8, 2012 at 3:35 PM, Brendan Eich bren...@mozilla.com mailto:bren...@mozilla.com wrote: Firebug uses a library bind a lot, and we continually struggled with the memoization

Re: ES6 doesn't need opt-in

2012-01-09 Thread Andreas Rossberg
On 6 January 2012 03:37, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Here is a possible set of rules for implicitly assigning ES5 or ES6 semantics to a Program unit In an ES6 implementation, all constructs that can occur in a valid program fit into one of these categories: ES6-only:  

Re: Boolean shortcuts

2012-01-09 Thread Herby Vojčík
Hi, I have looked at the links and as I understand they are trying to accomplish something slightly different, by adopting code as kind of data, though it is interesting, too (and your are true do-expressions do it elegantly, except for the explicit zero-arg lambda thing (I think || is not

Re: Improving Function.prototype.bind

2012-01-09 Thread David Bruant
Le 08/01/2012 19:47, John J Barton a écrit : (...) window.addEventListener('load', boundOnLoad, false); ... window.removeEventListener('load', boundOnLoad, false); The JS method 1) must be bound to the correct object 2) be reference-able for the removeEventListener. This combination

Re: Improving Function.prototype.bind

2012-01-09 Thread Andrea Giammarchi
indeed ... inline functions are problem number 2, anonymous or not, unless the removeEventListener is not performed inside the function itself so that at least the function name could be reused while if anonymous and use strict is in place there's no way to know which function is it. However, two

Re: ES6 doesn't need opt-in

2012-01-09 Thread Brendan Eich
On Jan 9, 2012, at 2:49 AM, Andreas Rossberg wrote: On 5 January 2012 20:10, Brendan Eich bren...@mozilla.com wrote: On Jan 5, 2012, at 6:31 AM, Andreas Rossberg wrote: Sorry, I still think that a growing set of subtle implicit rules for activating subtle semantic changes Not changes, new

Re: ES6 doesn't need opt-in

2012-01-09 Thread Brendan Eich
On Jan 9, 2012, at 7:54 AM, Brendan Eich wrote: The question is how bad these will be for anyone writing JS naively, based on current and emerging (ES6) docs, without explicit opt-in. The answer entails at least: 1. ES5-strict semantic changes, e.g. arguments aliasing, without early

Re: Improving Function.prototype.bind

2012-01-09 Thread Brendan Eich
On Jan 9, 2012, at 12:29 AM, David Bruant wrote: Le 09/01/2012 06:29, Brendan Eich a écrit : On Jan 8, 2012, at 7:20 PM, John J Barton wrote: On Sun, Jan 8, 2012 at 3:35 PM, Brendan Eich bren...@mozilla.com wrote: Firebug uses a library bind a lot, and we continually struggled with the

Re: ES6 doesn't need opt-in

2012-01-09 Thread Andreas Rossberg
On 9 January 2012 16:54, Brendan Eich bren...@mozilla.com wrote: The question is how bad these will be for anyone writing JS naively, based on current and emerging (ES6) docs, without explicit opt-in. The answer entails at least: 1. ES5-strict semantic changes, e.g. arguments aliasing,

Re: ES6 doesn't need opt-in

2012-01-09 Thread Allen Wirfs-Brock
On Jan 8, 2012, at 9:26 PM, Brendan Eich wrote: On Jan 8, 2012, at 4:53 PM, Mark S. Miller wrote: On Sun, Jan 8, 2012 at 10:32 AM, Brendan Eich bren...@mozilla.com wrote: [...] All cool with the above. Thanks. I wrote in a previous reply that we aren't preserving ES5 as a spec

Re: ES6 doesn't need opt-in

2012-01-09 Thread Gavin Barraclough
On Jan 9, 2012, at 2:59 AM, Andreas Rossberg wrote: I think the state machine is over-complicating things. What it boils down to is that we are defining a new language, ES6-proper (or informally ES6 for short). It overlaps with ES5 but does not include it (e.g. throws out `with'). Then your

Re: ES6 doesn't need opt-in

2012-01-09 Thread Allen Wirfs-Brock
On Jan 8, 2012, at 10:32 AM, Brendan Eich wrote: On Jan 8, 2012, at 8:28 AM, Mark S. Miller wrote: ... The other change I hope fits into the same bucket is http://wiki.ecmascript.org/doku.php?id=strawman:fixing_override_mistake. Right now, because of pressure from test262, we are in

Re: ES6 doesn't need opt-in

2012-01-09 Thread Brendan Eich
FTR (a broken record, sorry), I think we will do a big disservice to interoperation in practice (as enjoyed by future web devs) if we essentially fork the spec and mutate one copy (even excluding Clause 15) to be ES6. I'm still pretty sure implementations will not fork their non-library

Re: Improving Function.prototype.bind

2012-01-09 Thread Andrea Giammarchi
just to make it more concrete for those interested: http://webreflection.blogspot.com/2012/01/introducing-objecthandler.html IDL Like description and code ... to me this is a much faster/easier/better solution than Function#bind ... unshimmable for IE 9 but ... you know, some wrapper could do