Currently,

given $foo -> $bar
{
}

can be thought of as 

foreach my $bar ($foo)
{
}

Given the way people with expectations will interpret break, setting
break === last seems like the right thing to do.

=Austin

--- Larry Wall <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] writes:
> : --- Larry Wall <[EMAIL PROTECTED]> wrote:
> : > Simon Cozens writes:
> : > : Larry Wall:
> : > : > Not the same concept exactly.  I think a C<break> within a
> C<for>
> : > loop
> : > : > would be the same as a C<next>, not a C<last>.  
> : > : 
> : > : Doesn't this break C and Shell resonance?
> : > 
> : > We've done that before.  :-)
> : 
> : Umm, doesn't break translate basically as "leave, now" rather than
> as
> : "hop to the loop nexus and consider leaving"?
> 
> Sure, but it means "leave the switch now", not "leave the loop now".
> 
> : What's your thinking in equating break w/ next?
> 
> Only that
> 
>     for @foo {
>       ...
>     }
> 
> can be thought of as shorthand for
> 
>     for @foo -> $temp {
>       given $temp {
>           ...
>       }
>     }
> 
> I am also assuming that the break is only meaningful as a switch
> control,
> not a loop control.  But I can see where it would be confusing. 
> Perhaps
> C<break> should be illegal inside a C<for>, and the user forced to
> choose
> between C<next> and C<last>.
> 
> Larry

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

Reply via email to