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,
> -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
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
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";
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
> -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
> -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
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
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
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 01234 or 12345?
Joe Gottman
10 matches
Mail list logo