Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A6: Pipes

5 views
Skip to first unread message

Michael Lazzaro

unread,
Mar 10, 2003, 7:52:29 PM3/10/03
to perl6-l...@perl.org
Since noone else has said it yet -- This Apoc looks *great*. The sig
stuff is very, very nice. (The wrapper stuff has interesting
possibilities, too, especially with OO.)

Question on pipes: I like very much the concept of relating them only
to the variadic list, that was the piece we were all missing in the P6L
discussions. After reading that appendix, I'm still a bit murky on the
final decisions as to which of these edge cases will be allowed:

my @out <== (1,2,3);
my @out <== (my @in = foo());
my @out <== foo();

(1,2,3) ==> my @out;
(my @in = foo()) ==> my @out;
foo() ==> my @out;

Are these all valid, or do some of them have to be errors? I got lost
in the appendix explanation of what was confirmed, and what was
wishful-only...


FWIW, stylistically, I'd personally vote for

@in ==> map {...}
==> sort {...}
==> map {...}
==> @out;

as better than:

@in ==>
map {...} ==>
sort {...} ==>
map {...} ==>
@out;

... if we care about such details. :-)

MikeL

Damian Conway

unread,
Mar 10, 2003, 8:00:31 PM3/10/03
to perl6-l...@perl.org
Michael Lazzaro wrote:

> After reading that appendix, I'm still a bit murky on the
> final decisions as to which of these edge cases will be allowed:
>
> my @out <== (1,2,3);
> my @out <== (my @in = foo());
> my @out <== foo();
>
> (1,2,3) ==> my @out;
> (my @in = foo()) ==> my @out;
> foo() ==> my @out;

These are basically all just two edge-cases. Namely:

@var <== LIST
and:
LIST ==> @var

Larry is still leery, but I suspect they will ultimately be allowed.
Mainly because these:

@in ==> map {...}
==> sort {...}
==> map {...}
==> @out;

@out <== map {...}


<== sort {...}
<== map {...}

<== @in;

are much less annoying than:

@in ==> map {...}
==> sort {...}
==> map {...}

==> push @out;

push @out <== map {...}


<== sort {...}
<== map {...}

<== @in;

And because, as I demonstrated, the necessary overloaded multimethods are so
trivial to implement.

Damian

John Williams

unread,
Mar 11, 2003, 7:54:07 PM3/11/03
to Damian Conway, perl6-l...@perl.org
On Tue, 11 Mar 2003, Damian Conway wrote:
>
> These are basically all just two edge-cases. Namely:
>
> @var <== LIST
> and:
> LIST ==> @var
>

Have you considered:

LIST ==> @var.operator:=
LIST ==> @var.STOREARRAY
LIST ==> @var.how_do_i_spell_the_assignment_method

?

Damian Conway

unread,
Mar 11, 2003, 9:51:03 PM3/11/03
to perl6-l...@perl.org
John Williams wrote:

> Have you considered:
>
> LIST ==> @var.operator:=
> LIST ==> @var.STOREARRAY
> LIST ==> @var.how_do_i_spell_the_assignment_method

That's probably:

LIST ==> @var.STORE(*);

which is still pretty darn ugly. ;-)

Damian

0 new messages