Fwd: Re: Perl 6's for() signature

2003-08-14 Thread Austin Hastings
Fwd from Luke -- he's adopted a retarded MUA. --- Luke Palmer <[EMAIL PROTECTED]> wrote: > Date: Mon, 11 Aug 2003 21:22:05 -0600 > From: Luke Palmer <[EMAIL PROTECTED]> > Subject: Re: Perl 6's for() signature > > Austin Hastings writes: > > > And yo

Re: Perl 6's for() signature

2003-08-14 Thread Jonadab the Unsightly One
Luke Palmer <[EMAIL PROTECTED]> writes: > Yes, it's possible to have two routines with the same name which > differ by signature... however, in Perl 6, C has only one > signature, and it's the one above. The C loop you are thinking > of is spelled C, Oh, yes, forgot about that. > To the cont

Re: Perl 6's for() signature

2003-08-14 Thread Jonadab the Unsightly One
John Siracusa <[EMAIL PROTECTED]> writes: > Did this ever get resolved to anyone's satisfaction? While reading > EX6, I found myself wonder exactly what for() would look like in > Perl 6 code... A for loop[1] is basically syntax sugar for a while loop. In general, where foo, bar, baz, and quux

Re: Perl 6's for() signature

2003-08-14 Thread Luke Palmer
> Jonadab The Unsightly One wrote: > > > > John Siracusa <[EMAIL PROTECTED]> writes: > > > > > Did this ever get resolved to anyone's satisfaction? While reading > > > EX6, I found myself wonder exactly what for() would look like in > > > Perl 6 code... > > > > A for loop[1] is basically syntax

RE: Perl 6's for() signature

2003-08-14 Thread Austin Hastings
> -Original Message- > From: Luke Palmer [mailto:[EMAIL PROTECTED] > Austin Hastings writes: > > > From: Luke Palmer [mailto:[EMAIL PROTECTED] > > > > > Actually, in Perl 6, they'll do that anyway. Scope in loops is > > > strictly defined by the location of the braces WRT the location of

Re: Perl 6's for() signature

2003-08-14 Thread Benjamin Goldberg
Jonadab The Unsightly One wrote: > > John Siracusa <[EMAIL PROTECTED]> writes: > > > Did this ever get resolved to anyone's satisfaction? While reading > > EX6, I found myself wonder exactly what for() would look like in > > Perl 6 code... > > A for loop[1] is basically syntax sugar for a whi

RE: Perl 6's for() signature

2003-08-10 Thread Austin Hastings
> -Original Message- > From: Luke Palmer [mailto:[EMAIL PROTECTED] > Actually, in Perl 6, they'll do that anyway. Scope in loops is > strictly defined by the location of the braces WRT the location of > "my". That is: > > while (my $x = somefunc()) { ... } > # $x still in scope

Re: Perl 6's for() signature

2003-08-09 Thread Jonadab the Unsightly One
"Abhijit A. Mahabal" <[EMAIL PROTECTED]> writes: > There is another problem beyond efficiency: the P6 list semantics is lazy. > > The following is valid P6, AFAIK: > > for 1 .. Inf { > print $_; > last when 10; > } Yeah, but that's a foreach loop, despite the fact that "foreach" is spelled

Re: Perl 6's for() signature

2003-08-09 Thread Luke Palmer
> "Abhijit A. Mahabal" <[EMAIL PROTECTED]> writes: > > > There is another problem beyond efficiency: the P6 list semantics is lazy. > > > > The following is valid P6, AFAIK: > > > > for 1 .. Inf { > > print $_; > > last when 10; > > } > > Yeah, but that's a foreach loop, despite the fact th

Re: Perl 6's for() signature

2003-08-01 Thread Larry Wall
On Fri, Aug 01, 2003 at 11:01:15PM +0100, Simon Cozens wrote: : [EMAIL PROTECTED] (Damian Conway) writes: : > The last thought on the problem that Larry's shared with me was that there : > may need to be a special case for allowing a single &block parameter after : > the slurpy : : And the Rubyome

Re: Perl 6's for() signature

2003-08-01 Thread Simon Cozens
[EMAIL PROTECTED] (Damian Conway) writes: > The last thought on the problem that Larry's shared with me was that there > may need to be a special case for allowing a single &block parameter after > the slurpy And the Rubyometer creeps up another few notches... (Gosh, you'd almost think that Matz

Re: Perl 6's for() signature

2003-08-01 Thread Damian Conway
FWIW, we're aware of the problem. I posed this very question to Larry a few months back, when I was writing E6. We're still mulling over the correct answer. The last thought on the problem that Larry's shared with me was that there may need to be a special case for allowing a single &block param

Re: Perl 6's for() signature

2003-08-01 Thread Luke Palmer
> [EMAIL PROTECTED] (Rod Adams) wrote in message > > > Proposed behavior of *?@ : All Arguement to Parameter mapping left of it > > are processed Left to Right. Once seen, the mapping starts over right to > > left. Everything remaining is slurpable. > > > > Yes, it's more expensive to use, just li

Re: Perl 6's for() signature

2003-08-01 Thread Abhijit A. Mahabal
[EMAIL PROTECTED] (Rod Adams) wrote in message > Proposed behavior of *?@ : All Arguement to Parameter mapping left of it > are processed Left to Right. Once seen, the mapping starts over right to > left. Everything remaining is slurpable. > > Yes, it's more expensive to use, just like the RE vers

Re: Perl 6's for() signature

2003-08-01 Thread Brent Dax
John Siracusa: > Did this ever get resolved to anyone's satisfaction? While reading > EX6, I found myself wonder exactly what for() would look like in Perl 6 > code... Well, the easiest signature to do is probably: sub for([EMAIL PROTECTED]) { PRE { @list.end =~ Code } ...

Re: Perl 6's for() signature

2003-07-31 Thread Joe Gottman
- Original Message - From: "Hanson, Rob" <[EMAIL PROTECTED]> To: "'Rod Adams'" <[EMAIL PROTECTED]>; "Perl 6 Language" <[EMAIL PROTECTED]> Sent: Thursday, July 31, 2003 1:29 PM Subject: RE: Perl 6's for() signature &

Re: Perl 6's for() signature

2003-07-31 Thread attriel
> Anyone but me feel the need for non-greedy slurpy arrays? similar to > non-greedy RE matches? > Then we could do: > > sub for ([EMAIL PROTECTED], &block) {...} > > Proposed behavior of *?@ : All Arguement to Parameter mapping left of it > are processed Left to Right. Once seen, the mapping starts

RE: Perl 6's for() signature

2003-07-31 Thread Hanson, Rob
hing by slurping everything, then poping the block off of the array? Rob -Original Message- From: Rod Adams [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 12:56 PM To: Perl 6 Language Subject: Re: Perl 6's for() signature At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote: >

RE: Perl 6's for() signature

2003-07-31 Thread Rod Adams
about. -- Rod Rob -Original Message- From: Rod Adams [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2003 12:56 PM To: Perl 6 Language Subject: Re: Perl 6's for() signature At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote: >Well, I don't think it's possible, actually. Th

Re: Perl 6's for() signature

2003-07-31 Thread Jonathan Worthington
> At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote: > >Well, I don't think it's possible, actually. There's a flattening > >list context at the beginning (implying a sugary drink from 7 eleven), > >followed by a code block. But, as we know, slurpy arrays can only > >come at the end of positional pa

Re: Perl 6's for() signature

2003-07-31 Thread Rod Adams
At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote: Well, I don't think it's possible, actually. There's a flattening list context at the beginning (implying a sugary drink from 7 eleven), followed by a code block. But, as we know, slurpy arrays can only come at the end of positional parameters. Anyo

Re: Perl 6's for() signature

2003-07-31 Thread John Siracusa
On Thursday, July 31, 2003, at 12:05 PM, Luke Palmer wrote: Well, I don't think it's possible, actually. There's a flattening list context at the beginning (implying a sugary drink from 7 eleven), followed by a code block. But, as we know, slurpy arrays can only come at the end of positional para

Re: Perl 6's for() signature

2003-07-31 Thread Luke Palmer
> From an old summary: > > http://www.perl.com/pub/a/2003/04/p6pdigest/20030427.html?page=2 > > > Paul Hodges took a crack at implementing for as a subroutine and came > up with > > something that didn't look too insane. Luke Palmer added a refinement > allowing > > for n at a time looping.

Perl 6's for() signature

2003-07-31 Thread John Siracusa
From an old summary: http://www.perl.com/pub/a/2003/04/p6pdigest/20030427.html?page=2 > Paul Hodges took a crack at implementing for as a subroutine and came up with > something that didn't look too insane. Luke Palmer added a refinement allowing > for n at a time looping. However, for reasons