Re: till (the flipflop operator, formerly ..)

2005-11-20 Thread Larry Wall
On Sun, Nov 20, 2005 at 08:51:03PM +0100, Ingo Blechschmidt wrote: : Hi, : : according to the new S03, till is the new name for the flipflop : operator. Presuming we can make it work out as an infix macro. : Do the flipflop operators of subroutines maintain own : per-invocation-of-the-sub states

statement_control() (was Re: lvalue reverse and array views)

2005-11-20 Thread Rob Kinyon
On 11/20/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: [snip] > Yep. Also note that "for" is not a special magical construct in Perl 6, > it's a simple subroutine (&statement_control:, with the signature > ([EMAIL PROTECTED], Code *&code)). (Of course, it'll usually be optimized.) > > Example: >

Re: lvalue reverse and array views

2005-11-20 Thread Rob Kinyon
On 11/20/05, Daniel Brockman <[EMAIL PROTECTED]> wrote: > Reversing an array, changing it, and then rereversing it --- > I think that kind of pattern is common. I would think that reversing a string, modifying it, then reversing it back is more common. Does modifying the reversal of a string modif

Re: Multidimensional argument list binding (*@;foo)

2005-11-20 Thread Luke Palmer
On 11/20/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > sub foo (*@;AoA) { @;AoA } > > my @array1 = ; > my @array2 = ; > > my @AoA = foo @array1, @array2; > say [EMAIL PROTECTED]; # 2? 1 > say [EMAIL PROTECTED]; # a b c? a b c d e f However, my @AoA = foo(@

Multidimensional argument list binding (*@;foo)

2005-11-20 Thread Ingo Blechschmidt
Hi, quoting r6624 of S06 [1]: > Some functions take multiple Lists that they wish not to be flattened > into one list. For instance, C wants to iterate several lists > in parallel, while array and hash subscripts want to process > multidimensional slices. The set of underlying argument list (List

till (the flipflop operator, formerly ..)

2005-11-20 Thread Ingo Blechschmidt
Hi, according to the new S03, till is the new name for the flipflop operator. Do the flipflop operators of subroutines maintain own per-invocation-of-the-sub states? I.e.: sub foo (&x) { x() till 0 } foo { 0 }; # evaluates to a false value, of course foo { 1 }; # evaluates to a t

Re: Hyphens vs. Underscores

2005-11-20 Thread Robin Redeker
On Thu, Nov 17, 2005 at 04:05:30AM +0100, Daniel Brockman wrote: > That is, hyphen and underscore are synonymous in identifiers, > but an initial hyphen is not taken to be part of the identifier. > Why not make this feature generic and define equivalence classes for equivalent characters in an id

Re: \x{123a 123b 123c}

2005-11-20 Thread Patrick R. Michaud
On Sat, Nov 19, 2005 at 06:32:17PM -0800, Larry Wall wrote: > On Sun, Nov 20, 2005 at 01:26:21AM +0100, Juerd wrote: > : Ruud H.G. van Tol skribis 2005-11-20 1:19 (+0100): > : > Maybe > : > "\x{123a 123b 123c}" > : > is a nice alternative of > : > "\x{123a} \x{123b} \x{123c}". > > We

Re: lvalue reverse and array views

2005-11-20 Thread Ingo Blechschmidt
Hi, Juerd wrote: > Ingo Blechschmidt skribis 2005-11-20 16:44 (+0100): >> Where is the difference (for the user) between a subroutine which >> returns an appropriate proxy object and an array? > > The big difference between pure arrays and referenced arrays, for the > user, is that pure arrays fl

Re: lvalue reverse and array views

2005-11-20 Thread Juerd
Ingo Blechschmidt skribis 2005-11-20 16:44 (+0100): > Where is the difference (for the user) between a subroutine which > returns an appropriate proxy object and an array? An object is a scalar, an array is an array. Perl has unreferenced arrays --I like to call them "pure" arrays--, and reference

Re: lvalue reverse and array views

2005-11-20 Thread Ingo Blechschmidt
Hi, Juerd wrote: > Will Perl 6 support mutable for-reverse? I'd like it! :) > Some possible answers that I could think of: > > (a) Yes, but as a special case > (b) Yes, because reverse returns lvalue aliases > (c) No > > But there's another one, that I didn't immediately think of: > > (d) Yes

Re: lvalue reverse and array views

2005-11-20 Thread Juerd
Daniel Brockman skribis 2005-11-20 6:58 (+0100): > Well, wouldn't pushing an element onto @xyzzy be more like > pushing the car to @foo and the cdr to @bar, or throwing an > exception if the new element is not a Pair? Zipping has nothing to do with pairs, though! Consider, for example: @foo