Block lambda is cool, its syntax isn't

Axel Rauschmayer axel at rauschma.de
Thu Jan 19 17:58:31 PST 2012


Playing devil’s advocate: The main benefit of having a function shorthand in addition to block lambdas is that minimizers profit from it, right? For the use case that you showed, I wouldn’t mind at all to type the slightly longer "function". I most mind function expressions as parameters (for, say, Array.prototype.forEach) where lambda blocks are perfect.


On Jan 19, 2012, at 22:47 , François REMY wrote:

> Yet they are cases where a block lambda isn’t suited and where a ‘classic’ function is just too long to type (and would hurt performance as well). Look back in the thread for a sample. (Mainly: cases involving a ‘return’ in a loop or in a nested statement can’t be solved well using block-lambda).
>  
> Block lambda is not the solution since it wasn’t written to solve the cases where we traditionnaly use a 'local function’, but to solve new use-cases where we want our function to continue to run inside a function structure, or asynchronously. The old cases where we use “function() { ... { ... return; } ... }” are not covered properly by block lambda, nor are intended to.
>  
> From: Axel Rauschmayer
> Sent: Thursday, January 19, 2012 10:14 PM
> To: Brendan Eich
> Cc: Andreas Rossberg ; François REMY ; Oliver Hunt ; es-discuss Steen
> Subject: Re: Block lambda is cool, its syntax isn't
> FTR: With block lambdas and object literal extensions, I wouldn’t want/need a function shorthand.


-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120120/d067ef23/attachment-0001.html>


More information about the es-discuss mailing list