Re: NEXT and the general loop statement

2006-09-07 Thread Agent Zhang
On 8/17/06, Larry Wall <[EMAIL PROTECTED]> wrote: I'd say 01234 on the theory that the 3-arg loop is really saying: $n = 0; while $n < 5 { NEXT { ++$n } NEXT { print $n } } and also on the theory that block exiting blocks always run in reverse order. Dear Larry,

RE: NEXT and the general loop statement

2006-08-18 Thread Joe Gottman
> -Original Message- > From: Larry Wall [mailto:[EMAIL PROTECTED] > Sent: Friday, August 18, 2006 11:47 AM > To: Perl6 Language List > Subject: Re: NEXT and the general loop statement > > On Fri, Aug 18, 2006 at 01:44:35AM -0600, Luke Palmer wrote: > : On 8/17

Re: NEXT and the general loop statement

2006-08-18 Thread Larry Wall
On Fri, Aug 18, 2006 at 01:44:35AM -0600, Luke Palmer wrote: : On 8/17/06, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote: : >Depends on when it fires I guess. Your example might be equivalent to : >this perl5ish: : > : >while (1) { : >$num = rand; : >print $num; : >last

Re: NEXT and the general loop statement

2006-08-18 Thread Luke Palmer
On 8/17/06, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote: Depends on when it fires I guess. Your example might be equivalent to this perl5ish: while (1) { $num = rand; print $num; last if $num < 0.9; print ","; # NEXT } print "\n";

Re: NEXT and the general loop statement

2006-08-17 Thread Jonathan Scott Duff
On Thu, Aug 17, 2006 at 11:45:06PM -0400, Joe Gottman wrote: > > -Original Message- > > From: Luke Palmer [mailto:[EMAIL PROTECTED] > > Sent: Thursday, August 17, 2006 8:44 PM > > To: Perl6 Language List > > > > Wasn't NEXT supposed to do something tricky, such as being mutually > > exclus

RE: NEXT and the general loop statement

2006-08-17 Thread Joe Gottman
> -Original Message- > From: Luke Palmer [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 17, 2006 8:44 PM > To: Perl6 Language List > > Wasn't NEXT supposed to do something tricky, such as being mutually > exclusive with LAST? I remember a debate some time ago where some > complained

RE: NEXT and the general loop statement

2006-08-17 Thread Joe Gottman
> -Original Message- > From: Luke Palmer [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 17, 2006 8:44 PM > To: Perl6 Language List > Subject: Re: NEXT and the general loop statement > Wasn't NEXT supposed to do something tricky, such as being mutually &g

Re: NEXT and the general loop statement

2006-08-17 Thread Luke Palmer
On 8/16/06, Larry Wall <[EMAIL PROTECTED]> wrote: : Is the output 01234 or 12345? I'd say 01234 on the theory that the 3-arg loop is really saying: $n = 0; while $n < 5 { NEXT { ++$n } NEXT { print $n } } and also on the theory that block exiting blocks always run i

Re: NEXT and the general loop statement

2006-08-16 Thread Larry Wall
On Wed, Aug 16, 2006 at 08:21:29PM -0400, Joe Gottman wrote: : Is a NEXT clause called before or after the update portion of a general loop : statement? For instance, consider the following code: : : : : loop $n = 0; $n < 5; ++$n { : : NEXT {print $n;} : : } : : : : Is the output 012