Block Lambdas: break and continue

Tab Atkins Jr. jackalmage at gmail.com
Sat Jan 14 17:01:32 PST 2012


On Sat, Jan 14, 2012 at 2:05 PM, Brendan Eich <brendan at mozilla.org> wrote:
> This reminds me of dherman's escape continuation proposal:
>
> http://wiki.ecmascript.org/doku.php?id=strawman:return_to_label
>
> We did not promote it from Strawman to Harmony status.

It's likely no accident, but the direct Lisp equivalent to this (BLOCK
and RETURN-FROM
<http://www.lispworks.com/documentation/HyperSpec/Body/s_block.htm>)
have proven useful to me many times when I needed to either continue
or break from a macro-defined looping construct.

I support the author being able to declare their own capacity to
escape from block-lambda-driven "loops" using this mechanism.  I like
it *much* better than attempting to discriminate somehow between
lambda-driven "loops" and other lambda-driven constructs, or some
lambda-driven constructs invisibly handling break/continue themselves.
 Plus, it's *very* often useful to escape multiple levels of loops,
which is not solved by extending break/continue, but *is* solved by
return-to-label.

~TJ


More information about the es-discuss mailing list