Re: arrow function syntax simplified

2012-04-08 Thread Angus Croll
On Fri, Mar 30, 2012 at 4:46 AM, Felix Böhm esdisc...@feedic.com wrote: How about a loose-bound |this|, so that the function falls back to the bound |this| instead of the global scope when no other options are available (or `null` or `undefined` are passed to `.apply/.bind/.call`)? I

Re: Questions re. final fat arrow syntax

2012-04-08 Thread Axel Rauschmayer
3. Are parenthese required for zero arguments or will let a = = doThis(); syntax be permitted (in line with CS) This too is clearly specified by http://wiki.ecmascript.org/doku.php?id=strawman:arrow_function_syntax#grammar_changes ArrowFormalParameters, second right-part. That seems

Re: Questions re. final fat arrow syntax

2012-04-08 Thread Brendan Eich
Not given. TC39ers (not all, just ones near me) started blenching (or is it blanching? no, blenching). The issue was muddled because the optional body-block was mixed in (i.e., the minimal arrow function, as in CoffeeScript, was just |=| in the previous version of the strawman). As I've said

Re: Questions re. final fat arrow syntax

2012-04-08 Thread Axel Rauschmayer
As I've said a couple of times here, we could try again to reach consensus on making () as empty arrow formal parameter list optional, Seems useful, but not worth upsetting anyone over. and separately consider making an empty body-block optional. Sorry if I missed this, but: What would

Re: Complete Minimal Classes

2012-04-08 Thread Herby Vojčík
Kevin Smith wrote: I like your new(){}/static(){} idea at a glance. Need to ruminate (moo!) on it at length. I can't give you a use case (it's just a felling of being a good design thing), but I would like the classes be higher-level construct based on low-level ones. If

Re: arrow function syntax simplified

2012-04-08 Thread Herby Vojčík
Angus Croll wrote: On Fri, Mar 30, 2012 at 4:46 AM, Felix Böhm esdisc...@feedic.com mailto:esdisc...@feedic.com wrote: How about a loose-bound |this|, so that the function falls back to the bound |this| instead of the global scope when no other options are available (or `null` or

Re: arrow function syntax simplified

2012-04-08 Thread Angus Croll
On Apr 8, 2012, at 4:00, Herby Vojčík he...@mailbox.sk wrote: No special cases for null or undefined, please. Fine. Then we should just default to lexical binding for standalone function calls - I'll stick my neck out and assert that it's the only area that needs fixing with respect to

Re: arrow function syntax simplified

2012-04-08 Thread Angus Croll
I don't see anything that is broken by arrow functions. You are attempting to use arrows for defining methods which is incorrect. Sorry, I obfuscated unnecessarily by making the inner functions into arrows too. But the important one is the withCircleUtilsFat function which is not a method

Re: arrow function syntax simplified

2012-04-08 Thread Kevin Smith
Which form has more brevity, then? // This? var withCircleUtilsFat = () = { ... }; // Or this? function withCircleUtilsFat() { ... }; In any case, between object literal methods and arrow functions, I think you'll find that the vast majority of your function expressions will get

Re: Complete Minimal Classes

2012-04-08 Thread Kevin Smith
I can't give you a use case (it's just a felling of being a good design thing), but I would like the classes be higher-level construct based on low-level ones. If new()/static() gets in, it defines its own exclusive semantics not possible to do by plain constructor I agree in general, but

Re: Complete Minimal Classes

2012-04-08 Thread Axel Rauschmayer
But isn’t a clear separation of responsibility better? Want a constructor = use a class declaration. Want a callable = use an arrow function. I always disliked that some functions in ECMAScript 5 can be invoked as either a function or a constructor. What would you want an entity Foo for that

Re: Complete Minimal Classes

2012-04-08 Thread Kevin Smith
I always disliked that some functions in ECMAScript 5 can be invoked as either a function or a constructor. What would you want an entity Foo for that can be invoked in two ways? E.g.: new Foo(...) Foo(...) Maybe Brendan can answer that one? : ) Seriously, though, it's a fair

Re: arrow function syntax simplified

2012-04-08 Thread Angus Croll
Ha! nice catch :-) My concern is with developers not knowing about the side effects of = and therefore when to use it. On Sun, Apr 8, 2012 at 4:09 PM, Kevin Smith khs4...@gmail.com wrote: Which form has more brevity, then? // This? var withCircleUtilsFat = () = { ... }; // Or