Control invocation syntax

Neal Gafter neal at
Mon Dec 14 10:48:00 PST 2009

On Mon, Dec 14, 2009 at 10:33 AM, Paul Benedict <pbenedict at>wrote:

> The syntax reads:
> ControlInvocationStatement:
>  foropt Primary ( FormalParameters : ExpressionListopt ) Statement
>  foropt Primary ( ExpressionListopt ) Statement
> But the "with" method declaration does not use the "for" keyword. Am I
> misunderstanding? It is used in Loop Abstractions, which I expect.

The "for" keyword is optional when defining a method that is intended to be
used with the contol invocation syntax.  It is used when the method is
intended to be used like a loop.  The "with" method is not intended to be
used as a loop, so it is not defined with the "for" keyword.  That means
that "break" and "continue" ignore a control invocation of the "with"

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the closures-dev mailing list