> -----Original Message-----
> From: Mark A. Biggar [mailto:[EMAIL PROTECTED]
>
> Brent 'Dax' Royal-Gordon wrote:
>
> > chromatic wrote:
> >
> >> Perl.com has just made A12 available:
> >
> >
> > I started reading it last night, and ended up going to bed before I was
> > finished.  But I just wanted to say that this:
> >
> >     With this dispatcher you can continue by saying "next METHOD".
> >
> > is the sort of genius that makes me glad Larry's designing this
> > language.  Well done!
> >
>
> Yeah, remmeber from A4 that flow control stuff like "next", "leave",
> "return" are semantically a form of exception throw and so are actaully
> dymanically (not lexically) scoped (although the compiler is free to
> optimize if the target is in the lexical scope of the construct or
> vice versa).

I kind of have a problem with this on fragility grounds.

Not so much the C<next METHOD> syntax, as the whole non-local-goto idea.

Specifically, if you have code that uses C<next> or C<last> without the loop
name, it's vulnerable to having additional control structures inserted in
the flow. (If the named approach is used, it's vulnerable to having named
entities inserted in the flow. Less vulnerable, but vulnerable.)

I'm wondering if there's some way to convert C<next METHOD> into C<next
$METHOD>, such that each loop would have a unique "identity" that could be
passed around.

This would raise the bar for erroneous invocations, and at the same time
make slightly more programmatic things possible. (Sure, C<eval "next
$meth;";> works, but at what price?)

=Austin

Reply via email to