Expression closures - use-cases for shortcut lambda syntax (blocks)

Vassily Gavrilyak gavrilyak at gmail.com
Fri Mar 16 17:25:15 PDT 2007


I agree that  (\  is not familiar for  Perl or Ruby developers.
It's Haskell's idiom and the combination (not a slash) just looks like
lambda, that's why we choose it.
Maybe it looks for good me because cyrillic analog of letter lambda looks
exactly this way :-)
(\ x -> 3*x + x/4) [1,2,3,4].
Parenthesis are not mandatory in Haskell and I think that's why you thought
about slash before and not after.
But I agree that it is new for JS users.
What's left from other languages
| |  from Ruby -> or => from ML, Haskell again, haXe, Groovy and C#.

| | loolks better for me and I like Andrew's proposal. It clears the
parenthesis and seems to work  nicely with current syntax and functions
expressions () too.
The only thing worried me - without arguments it will be exactly the ||
operator.

>> -Blocks with proposed syntax are simple to implement and do not
>> break current code.
>True, but same goes for expression closures.
Expressions closures are genius idea and I like it very much. It just covers
different use cases.

Vassily Gavrilyak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20070317/aafd77e7/attachment-0002.html 


More information about the Es4-discuss mailing list