RE: what kind of problem is this fat arrow feature trying to solve ?

2013-10-01 Thread Andrea Giammarchi
Since every => Since ever Sent from my Windows Phone -- From: Andrea Giammarchi Sent: 10/1/2013 7:35 PM To: Tab Atkins Jr. Cc: es-discuss@mozilla.org Subject: Re: what kind of problem is this fat arrow feature trying to solve ? setTimeout accept extra arguments ..

Re: what kind of problem is this fat arrow feature trying to solve ?

2013-10-01 Thread Andrea Giammarchi
setTimeout accept extra arguments ... I write JavaScript that uses this feature. `setTimeout(callback, delay, arg1, arg2, argN, evenAnObject);` so fat arrow does not solve much here, I can use self as first argument and I am good. `forEach` and all other arrays accept a second argument `array.f

Re: Clarification on function default param values

2013-10-01 Thread Mark Miller
On Tue, Oct 1, 2013 at 3:16 PM, Claus Reinke wrote: > Generally variables are brought into scope by an explicitly appearing >> defining occurrence. Two exceptions are the "function" brings into scope >> both "this" and "arguments". These remain in scope until shadowed by a >> nested "function" or

Collecting tips for getting involved in web standards

2013-10-01 Thread Domenic Denicola
I'm giving a talk in a couple days at LXJS, and part of it is to teach the attendees how standards work and how they can get involved. I'm putting together tips, based on my experiences over the last year or so, and was wondering if the members of these lists had anything they wanted to contribu

Re: Question on arrow function - if it is a bug or intentional in the spec ?

2013-10-01 Thread Allen Wirfs-Brock
On Oct 1, 2013, at 4:35 PM, Suresh Jayabalan wrote: > According to 14.2.1, the following arrow function expression should produce > an early error : > > x => {var x;} > > Here is the spec line that mandates this rule. While this scenario is allowed > in the regular functions (even in strict

Question on arrow function - if it is a bug or intentional in the spec ?

2013-10-01 Thread Suresh Jayabalan
According to 14.2.1, the following arrow function expression should produce an early error : x => {var x;} Here is the spec line that mandates this rule. While this scenario is all

Re: what kind of problem is this fat arrow feature trying to solve ?

2013-10-01 Thread Tab Atkins Jr.
On Tue, Oct 1, 2013 at 3:43 PM, Andrea Giammarchi wrote: > 4. what kind of problem is this fat arrow feature trying to solve exactly, > if it cannot be used for classes, direct methods assignment, but only for > some runtime event assignment instead of using bind and still being unable > to remo

Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
oops, it wasn't intentional. I should have checked ... opened a new one. br On Tue, Oct 1, 2013 at 3:39 PM, Brendan Eich wrote: > Thread-hijacking is poor form. > > /be > ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/lis

what kind of problem is this fat arrow feature trying to solve ?

2013-10-01 Thread Andrea Giammarchi
Apologies for the off topic, I swear I thought I opened a new thread for that so here again my post. Thanks - - - - - - - - - - I need to read everything Brendan suggested but if anyone would be so kind to refresh my memories on this arrow function I'd appreciate that. I don't need much more than

Re: Clarification on function default param values

2013-10-01 Thread Brendan Eich
Thread-hijacking is poor form. /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Clarification on function default param values

2013-10-01 Thread Claus Reinke
Generally variables are brought into scope by an explicitly appearing defining occurrence. Two exceptions are the "function" brings into scope both "this" and "arguments". These remain in scope until shadowed by a nested "function" or by an explicit definition. Note that "this" can never be explic

Re: A new ES6 draft is available

2013-10-01 Thread Claude Pache
>>> Explicit .toString() calling is rare because verbose, in addition to >>> throwing on null and undefined. People use + ''. >> >> I tend to use `String(x)` (which is equivalent). > > Actually it isn't. String(x) is specified to call the ToString abstract > operation on x which in the curren

Re: A new ES6 draft is available

2013-10-01 Thread Allen Wirfs-Brock
On Oct 1, 2013, at 1:22 PM, Claude Pache wrote: > > >> Le 1 oct. 2013 à 19:33, Brendan Eich a écrit : >> >> Allen Wirfs-Brock wrote: Currently, that works for everything but null > and undefined, so I assume that this pattern is used quite a bit. >>> >>> Do you think it really is? >

Re: Clarification on function default param values

2013-10-01 Thread Dmitry Soshnikov
On Mon, Sep 30, 2013 at 8:21 PM, Brandon Benvie wrote: > On 9/30/2013 3:51 PM, Dmitry Soshnikov wrote: > >> Just re-read meeting notes, OK, cool on two scopes (seems like they are >> not in the spec yet). Want to double-check though: whether it will be >> possible to transpile now to ES3? From wh

Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
I need to read everything Brendan suggested but if anyone would be so kind to refresh my memories on this arrow function I'd appreciate that. I don't need much more than yes/no as answer, thanks. 1. `var o = {method: () => this};` will o.method() return o ? (I guess nope) Considering the follow

Re: A new ES6 draft is available

2013-10-01 Thread Claude Pache
> Le 1 oct. 2013 à 19:33, Brendan Eich a écrit : > > Allen Wirfs-Brock wrote: >>> Currently, that works for everything but null >>> > and undefined, so I assume that this pattern is used quite a bit. >> >> Do you think it really is? > > I don't. (That is, I don't see much x.toString() feedin

Re: Clarification on function default param values

2013-10-01 Thread Mark S. Miller
I agree that the discussions as I remember them do not go into this level of detail. Thanks for being so explicit about precise choices. However, I do recall that the consensus we had was enough to rule out #3, or indeed any solution where arrow functions have their own arguments object. And even

Re: Clarification on function default param values

2013-10-01 Thread Brendan Eich
Andrea Giammarchi wrote: Does `null` count as undefined too No. See the draft spec and many threads and meeting notes. /be ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Clarification on function default param values

2013-10-01 Thread Erik Arvidsson
3 and 7 both seems good. Personally I prefer #7 but I'm worried that it might be too surprising that arguments refers to the outer function. On Tue, Oct 1, 2013 at 11:11 AM, Allen Wirfs-Brock wrote: > > On Oct 1, 2013, at 12:03 AM, André Bargull wrote: > >> Brandon Benvie

Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
I see. Does `null` count as undefined too or it must be explicitly undefined ? not that using a transpiler this matters much ... just curious about how the ES < 6 will look like. On Tue, Oct 1, 2013 at 11:02 AM, Brendan Eich wrote: > No, we are using undefined actual parameter value, not argume

Re: Clarification on function default param values

2013-10-01 Thread Allen Wirfs-Brock
On Oct 1, 2013, at 12:03 AM, André Bargull wrote: >> > Brandon Benvie >> > September 30, 2013 8:48 PM >> > I'm actually now really curious what the following does: >> > >> > ``` >> > function foo(x, y = (() => { arguments[0] = "foo"; return "bar" })()) { >> > ret

Re: Clarification on function default param values

2013-10-01 Thread Brendan Eich
No, we are using undefined actual parameter value, not argument.length, to trigger defaulting -- as discussed many times and cited by me (again) recently in reply to Oliver. Please do not go backward. /be ___ es-discuss mailing list es-discuss@mozill

Re: Clarification on function default param values

2013-10-01 Thread Andrea Giammarchi
Just a quick one. I think the best representation in ES3 or 5 would be the following ```javascript function foo(x, y, z) { switch(arguments.length) { case 0: x = 1; case 1: y = 2; case 2: z = 3; } // whatever logic involved, i.e. return x + y + z; } ``` no break and no default

Re: A new ES6 draft is available

2013-10-01 Thread Brendan Eich
Allen Wirfs-Brock wrote: Currently, that works for everything but null > and undefined, so I assume that this pattern is used quite a bit. Do you think it really is? I don't. (That is, I don't see much x.toString() feeding into bracketed property lookup, if any.) Explicit .toString() call

Re: More robust links to sections in the ES6 HTML spec

2013-10-01 Thread Brendan Eich
<3 /be Jason Orendorff October 1, 2013 8:04 AM Links to sections have changed. Old: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.7.3.1 New: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-signed-right-shift-operator-runtime-semantics-

Re: A new ES6 draft is available

2013-10-01 Thread Allen Wirfs-Brock
On Oct 1, 2013, at 3:10 AM, Andreas Rossberg wrote: > On 30 September 2013 18:20, Allen Wirfs-Brock wrote: >> The lastest draft throws when doing an implicitly ToString conversion [1] >> of a Symbol primitive value. This means that (aSymbol + "suffix") or >> ("prefix" + aSymbol) [2] will throw

More robust links to sections in the ES6 HTML spec

2013-10-01 Thread Jason Orendorff
Links to sections have changed. Old: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.7.3.1 New: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-signed-right-shift-operator-runtime-semantics-evaluation Old-style links will still work. Use the new ones if you want them to cont

Re: Clarification on function default param values

2013-10-01 Thread Andreas Rossberg
On 30 September 2013 22:17, Jeff Morrison wrote: > So I think during the last meeting it was decided that we'd now have two > scopes for functions with default param values: One for head/params, and one > for the function body. > Was it also agreed that we'd use let-binding (vs var-binding) for th

Re: A new ES6 draft is available

2013-10-01 Thread Andreas Rossberg
On 30 September 2013 18:20, Allen Wirfs-Brock wrote: > The lastest draft throws when doing an implicitly ToString conversion [1] > of a Symbol primitive value. This means that (aSymbol + "suffix") or > ("prefix" + aSymbol) [2] will throw, which was the case that I believe > people were most conc

Re: Clarification on function default param values

2013-10-01 Thread André Bargull
>/ Brandon Benvie > />/ September 30, 2013 8:48 PM />/ I'm actually now really curious what the following does: />/ />/ ``` />/ function foo(x, y = (() => { arguments[0] = "foo"; return "bar" })()) { />/return