Juerd <[EMAIL PROTECTED]> writes:

> I think something like
>
>     my @bar := reverse @foo;
>
> would be very useful. Insert an element between positions 1 and 2, and
> the original @foo array gets them between positions -3 and -2.

That would be cool.  The concept is reminiscent of using a
change of basis to make your coordinates look nicer in a
vector space or something.

Reversing an array, changing it, and then rereversing it ---
I think that kind of pattern is common.

> The same thing would be interesting for zip:
>
>     my @xyzzy := @foo Y @bar;
>
> Assuming this results in an even number of elements in @xyzzy, pushing a
> single element onto @xyzzy could result in an element added to @foo
> every odd, and to @bar every even time.

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?

(What is Perl's pair terminology, by the way?)

-- 
Daniel Brockman <[EMAIL PROTECTED]>

Reply via email to