On May 21, 2011, at 9:57 PM, Bob Nystrom wrote:

> On Sat, May 21, 2011 at 1:24 PM, Brendan Eich <[email protected]> wrote:
> > It turns out now that it's really a dilemma what to choose -- arrows or 
> > blocks... have to think.
> 
> Arrow function syntax is "just syntax". I will drop it if we can agree on 
> block lambda revival. As @_sjs (Sami Samhuri) tweeted at me, "We'll always 
> have function." ;-)
> 
> I was worried that using these lambda blocks would be heavier-weight for the 
> functional idiomatic use cases where -> really shines. But since this 
> proposal also allows an implicit return, this actually ends up being even 
> more terse than -> functions:
> 
> let names = people.filter((p) -> p.lastName == 'Smith').map((p) -> 
> p.firstName);
> let names = people.filter({|p| p.lastName == 'Smith'}).map({|p| p.firstName});
> 
> For me, this is pretty compelling. It covers both the "roll your block 
> structure" use case and the "lightweight lambda" one. Nice!

Good one-liner A/B comparison -- thanks.

/be

P.S. This will help kill something in ECMA-357, E4X, that is sugar for 'with', 
where the sugar hooks the kids on the poison. The lightweight syntax of blocks 
is just about needed, including paren-free calls (not used in your example, 
good choice -- and good to have the choice).

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to