Re: Expression Closures as Compliment to Arrow Functions

2015-03-25 Thread Brendan Eich
Jacob Parker wrote: In the context of only objects and classes, is this format no-go? Without the } that closes a concise method body, there's a new problem to-do with computed property names: class C { m() this._m [Symbol.iterator]() {/*...*/} } We need a delimiter. Could use ;

Re: Expression Closures as Compliment to Arrow Functions

2015-03-25 Thread Jacob Parker
Could the comma not be the delimiter, as I think works with arrow functions, or is that more precedence issues? On Wed, 25 Mar 2015 8:37 am Brendan Eich bren...@mozilla.org wrote: Jacob Parker wrote: In the context of only objects and classes, is this format no-go? Without the } that closes

Re: Expression Closures as Compliment to Arrow Functions

2015-03-25 Thread Brendan Eich
Jacob Parker wrote: Could the comma not be the delimiter, as I think works with arrow functions, or is that more precedence issues? No precedence issue, due to AssignmentExpression (not Expression) being the right-most non-terminal produced by the unbraced alternative for ConciseBody.

RE: Expression Closures as Compliment to Arrow Functions

2015-03-25 Thread Isiah Meadows
...@gmail.com Cc: es-discuss@mozilla.org Date: Wed, 25 Mar 2015 14:30:28 +0100 Subject: Re: Expression Closures as Compliment to Arrow Functions Jacob Parker wrote: Could the comma not be the delimiter, as I think works with arrow functions, or is that more precedence issues? No precedence

Re: Expression Closures as Compliment to Arrow Functions

2015-03-24 Thread Brendan Eich
Brendan Eich wrote: var y = (a) = a ? f : x++ (1); evaluated (or is it syntactically valid at all)? The problem with expression closures is precedence inversion: you have LowPrec ~~ HighPrec ~~ stuff ending with LowPrec. The particular nonterminals are AssignmentExpression and

Re: Expression Closures as Compliment to Arrow Functions

2015-03-24 Thread Brendan Eich
Bergi wrote: Jacob Parker schrieb: Either I'm wrong, or that's missing some parens. Assume the following (the only interpretation I can see to not throw a syntax error), var y = (function (a) a ? f : x++)(1); In which case, that could only return `f`, which when printed should print

Re: Expression Closures as Compliment to Arrow Functions

2015-03-24 Thread Brendan Eich
Jacob Parker wrote: Either I'm wrong, or that's missing some parens. No, test it yourself in Firefox (s/print/console.log/) or SpiderMonkey. Assume the following (the only interpretation I can see to not throw a syntax error), var y = (function (a) a ? f : x++)(1); In which case, that

Re: Expression Closures as Compliment to Arrow Functions

2015-03-24 Thread Bergi
Jacob Parker schrieb: Either I'm wrong, or that's missing some parens. Assume the following (the only interpretation I can see to not throw a syntax error), var y = (function (a) a ? f : x++)(1); In which case, that could only return `f`, which when printed should print the source of f,

Re: Re: Expression Closures as Compliment to Arrow Functions

2015-03-24 Thread Jacob Parker
In the context of only objects and classes, is this format no-go? ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Expression Closures as Compliment to Arrow Functions

2015-03-24 Thread Jacob Parker
Either I'm wrong, or that's missing some parens. Assume the following (the only interpretation I can see to not throw a syntax error), var y = (function (a) a ? f : x++)(1); In which case, that could only return `f`, which when printed should print the source of f, no? FWIW, the consise

Re: Expression Closures as Compliment to Arrow Functions

2015-03-23 Thread Allen Wirfs-Brock
On Mar 23, 2015, at 10:42 AM, Jacob Parker jacobparker1...@gmail.com mailto:jacobparker1...@gmail.com wrote: I noticed expression closures, as defined below, have been excluded from the spec.

Re: Expression Closures as Compliment to Arrow Functions

2015-03-23 Thread Brendan Eich
Allen Wirfs-Brock wrote: including these, in addition to the existing shorthand syntaxes, should make the following examples work. var x = { value: 3, toString() 'string', valueOf() this.value }; class x { constructor { this.value = 3; } valueOf() this.value } what you show above