Re: Exegesis 4

2002-04-04 Thread Larry Wall
Piers Cawley writes: : Damian Conway <[EMAIL PROTECTED]> writes: : : > Larry explained: : > : >> : Umm. didn't you say bare blocks were going away? : >> : >> Rule #2 was invoked. : >> : >> The current thinking is that any bare block will never be interpreted : >> as returning a closure. Yo

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Larry explained: > >> : Umm. didn't you say bare blocks were going away? >> >> Rule #2 was invoked. >> >> The current thinking is that any bare block will never be interpreted >> as returning a closure. You have to use explicit C or C >> to retur

Re: Exegesis 4

2002-04-03 Thread Damian Conway
Larry explained: > : Umm. didn't you say bare blocks were going away? > > Rule #2 was invoked. > > The current thinking is that any bare block will never be interpreted > as returning a closure. You have to use explicit C or C > to return a closure. Or the equivalent of a C, namely:

Re: Exegesis 4

2002-04-03 Thread Damian Conway
Larry wrote: > > [EMAIL PROTECTED] writes: > : On 4/3/02 6:44 PM, Damian Conway wrote: > : > Larry has said very clearly that in Perl 6 there are no "magical" lexical > : > scopes. > : > : Shouldn't this be: "Larry has said very clearly that in Perl 6 there is only > : one 'magical' lexical scope

Re: Exegesis 4

2002-04-03 Thread Larry Wall
[EMAIL PROTECTED] writes: : On Wednesday 03 April 2002 18:24, Larry Wall wrote: : > : > Sure, just say : > : > { loop (my $i = intializer(); condition($i); $i = advance($i)) { ... } : } : > : > : Perhaps something like: : > : : > : initalizer() -> $i { LOOP: NEXT { $i = advance($i); redo

Re: Exegesis 4

2002-04-03 Thread Larry Wall
[EMAIL PROTECTED] writes: : On 4/3/02 6:44 PM, Damian Conway wrote: : > Larry has said very clearly that in Perl 6 there are no "magical" lexical : > scopes. : : Shouldn't this be: "Larry has said very clearly that in Perl 6 there is only : one 'magical' lexical scope: sub() or ->" It's specific

Re: Exegesis 4

2002-04-03 Thread Luke Palmer
> { > my @subs; > loop (my $x = 0; $x < 10; $x++) { > push @subs, { $^a + $x }; > } > $x--; > # ... > } > > This certainly does *not* DWIM in the current thought. And the silence > would be much more confusing than a simple syntax error the traditiona

Re: Exegesis 4

2002-04-03 Thread Luke Palmer
> Larry has said very clearly that in Perl 6 there are no "magical" lexical scopes. > That is, variables declared in a C control aren't magically in the > following block. However, I don't agree with him. It may be more intuitive to newcomers, but it is a common programming idiom that is used a

Re: Exegesis 4

2002-04-03 Thread John Siracusa
On 4/3/02 6:44 PM, Damian Conway wrote: > Larry has said very clearly that in Perl 6 there are no "magical" lexical > scopes. Shouldn't this be: "Larry has said very clearly that in Perl 6 there is only one 'magical' lexical scope: sub() or ->" -John

Re: Exegesis 4

2002-04-03 Thread Bryan C. Warnock
On Wednesday 03 April 2002 18:24, Larry Wall wrote: > > Sure, just say > > { loop (my $i = intializer(); condition($i); $i = advance($i)) { ... } } > > : Perhaps something like: > : > : initalizer() -> $i { LOOP: NEXT { $i = advance($i); redo LOOP if > : condition($i);} ... } > : > : ex

Re: Exegesis 4

2002-04-03 Thread Damian Conway
Mark J. Reed wrote: > > # Perl 5 code > for (my $i=0; 1; $i++) { > > which would translate into Perl 6 as: > > > loop (my $i=0; 1; $i++) { > > > May I infer from this the return of loop-scoped variables (in > which the loop control variab

Re: Exegesis 4: reduce?

2002-04-03 Thread Andrew Wilson
On Thu, Apr 04, 2002 at 09:37:19AM +1000, Damian Conway wrote: Ah yes, that makes a lot of sense. Thank you. Andrew

Re: Exegesis 4: reduce?

2002-04-03 Thread Damian Conway
Andrew Wilson wrote: > I'm sure I'm missing something fairly fundamental, but could someone > shed more light on the example: > > # reduce list three-at-a-time > $sum_of_powers = reduce { $^partial_sum + $^x ** $^y } 0, @xs_and_ys; > > specifically what is being iterated over, what gets bound

Re: Exegesis 4

2002-04-03 Thread Larry Wall
Buddha Buck writes: : At 07:57 AM 04-03-2002 -0800, Larry Wall wrote: : >Mark J. Reed writes: : >: loop (my $i=0; 1; $i++) { : >: : > : >No, the scope of $i stays outside, per the previous decision. If you : >want it inside you can always make $i an official formal parameter: : > : >

Exegesis 4: reduce?

2002-04-03 Thread Andrew Wilson
Hi I'm sure I'm missing something fairly fundamental, but could someone shed more light on the example: # reduce list three-at-a-time $sum_of_powers = reduce { $^partial_sum + $^x ** $^y } 0, @xs_and_ys; specifically what is being iterated over, what gets bound and what does it return? I tho

Re: Exegesis 4

2002-04-03 Thread John Siracusa
On 4/3/02 12:07 PM, Brent Dax wrote: > John Siracusa: > # On 4/3/02 3:44 AM, Damian Conway wrote: > # > Larry indicated to me that blockless declarations of > # methods and subs would be illegal. > # > # What's the motivation for this? > > I assume it's to support the Perl 5 blockless style. Ah

RE: Exegesis 4

2002-04-03 Thread Brent Dax
John Siracusa: # On 4/3/02 3:44 AM, Damian Conway wrote: # > Larry indicated to me that blockless declarations of # methods and subs # > would be illegal. # # What's the motivation for this? It seems to me that # pre-declarations would # be just as nice (or nicer) as: # # module Alpha; #

Re: Exegesis 4

2002-04-03 Thread Buddha Buck
At 07:57 AM 04-03-2002 -0800, Larry Wall wrote: >Mark J. Reed writes: >: loop (my $i=0; 1; $i++) { >: > >No, the scope of $i stays outside, per the previous decision. If you >want it inside you can always make $i an official formal parameter: > > for 0 .. Inf -> $i { ... } > >I t

Re: Exegesis 4

2002-04-03 Thread John Siracusa
On 4/3/02 3:44 AM, Damian Conway wrote: > Larry indicated to me that blockless declarations of methods and subs > would be illegal. What's the motivation for this? It seems to me that pre-declarations would be just as nice (or nicer) as: module Alpha; package Beta; method Gamma::del

Re: Exegesis 4

2002-04-03 Thread Larry Wall
Mark J. Reed writes: : : # Perl 5 code : for (my $i=0; 1; $i++) { : : which would translate into Perl 6 as: : : : loop (my $i=0; 1; $i++) { : : : May I infer from this the return of loop-scoped variables (in : which the loop control v

Re: Exegesis 4

2002-04-03 Thread Mark J. Reed
# Perl 5 code for (my $i=0; 1; $i++) { which would translate into Perl 6 as: loop (my $i=0; 1; $i++) { May I infer from this the return of loop-scoped variables (in which the loop control variable is magically inser

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: >> > Eventually, of course, we'll have to go back and make eveything >> > copacetic, but at the moment I think most folks would rather have us >> > working on writing unwritten A's and E's, rather than rewriting >> > written ones. ;-) >> >> Point. Maybe

Re: Exegesis 4

2002-04-03 Thread Damian Conway
> > Eventually, of course, we'll have to go back and make eveything > > copacetic, but at the moment I think most folks would rather have us > > working on writing unwritten A's and E's, rather than rewriting > > written ones. ;-) > > Point. Maybe someone will step up to plate and do Perl 6 so fa

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: >> Good oh. BTW, (and apologies for repeating the question I asked >> elsewhere) are we going to see an updated Apocalypse 4 incorporating >> all the changes made to get E4 to work? > > Probably not any time soon. Previous Apocalypses haven't been > updat

Re: Exegesis 4

2002-04-03 Thread Damian Conway
> Good oh. BTW, (and apologies for repeating the question I asked > elsewhere) are we going to see an updated Apocalypse 4 incorporating > all the changes made to get E4 to work? Probably not any time soon. Previous Apocalypses haven't been updated when changes were made. Eventually, of course,

Re: Exegesis 4

2002-04-03 Thread Piers Cawley
Damian Conway <[EMAIL PROTECTED]> writes: > Piers wrote: > >> Over on use.perl, someone spotted what looks like a bug in the example >> program which (if it *is* a bug) is fixed by using unary '*', but >> that's not what I'm writing about here. > > I'll admit I'm not sure whether it is a bug or n

Re: Exegesis 4

2002-04-03 Thread Damian Conway
Piers wrote: > Over on use.perl, someone spotted what looks like a bug in the example > program which (if it *is* a bug) is fixed by using unary '*', but > that's not what I'm writing about here. I'll admit I'm not sure whether it is a bug or not. I've asked Larry for clarification and will post

Exegesis 4

2002-04-03 Thread Piers Cawley
Over on use.perl, someone spotted what looks like a bug in the example program which (if it *is* a bug) is fixed by using unary '*', but that's not what I'm writing about here. In the discussion of the yadda yadda yadda operator, Damian says that ... in this example, Err::BadData is *never*