Block Lambdas: break and continue
Brendan Eich
brendan at mozilla.org
Sun Jan 15 07:36:32 PST 2012
> Grant Husbands <mailto:esdiscuss at grant.x43.net>
> January 15, 2012 3:51 AM
> Brendan Eich wrote:
>> More when I reply to Axel in a bit.
>
> I think there may have been a misunderstanding. My proposed solution
> amounts to syntactic sugar over the existing strawman and makes
> break/continue work intuitively with loopy block lambdas, and your
> reply to Axel appears to be against an exception-based version, but
> you seem to have (implicitly) tied them together.
That's right, because I don't see how your proposal can work without
exceptions. You write that it is yntactic sugar. Ok, what is the
desugaring? How does
> for arr.ForEach { |o|
> if (...) break;
> }
>
> And it still works, without needing to throw exceptions or alter the
> existing library code.
translate into JS without a throw that the implementation of
arr.forEach, which is not modfiied by this for-prefixed invocation, can
catch?
/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120115/adc2429b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120115/adc2429b/attachment.jpg>
More information about the es-discuss
mailing list