Block Lambdas: break and continue

Brendan Eich brendan at mozilla.org
Sun Jan 15 23:46:58 PST 2012


> Axel Rauschmayer <mailto:axel at rauschma.de>
> January 15, 2012 11:32 PM
> The main problem I would have with "for" as a prefix is semantic, not 
> grammatical: I would always expect to loop over something iterable and 
> not a loop implementation.

Yes, I agree with that and it's what I meant by head-less body (or is it 
body-less head?).

But the syntactic ambiguity is a problem too.

> My impression: Let’s wait until we have a more powerful collection 
> library (which I assume would use block lambdas extensively). Then it 
> should become clear where/if people miss break and continue. A label 
> is a reasonable work-around that should even survive the insertion of 
> a “loop-ifying” keyword.

Agreed.
>
> Could we call block lambdas just lambdas? The former seems a bit 
> pleonastic.
Love that word. I didn't intend a pleonasm but I definitely felt some 
need to distinguish block-lambdas from Ruby blocks (while also giving 
them a hat tip), and from other lambda strawman proposals, especially

http://wiki.ecmascript.org/doku.php?id=strawman:lambdas

This looks orphaned in the wiki, so maybe there's no more chance of 
confusion. Happy to use "lambda" if I'm not stepping on someone else's toes.

/be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120115/4dce5098/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1222 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120115/4dce5098/attachment-0001.jpg>


More information about the es-discuss mailing list