--- "Mr. Nobody" <[EMAIL PROTECTED]> wrote:
> --- Thom Boyer <[EMAIL PROTECTED]> wrote:
> > Mr. Nobody <[EMAIL PROTECTED]> wrote:
> > > --- Damian Conway <[EMAIL PROTECTED]> wrote:
> > > >         @a ~> grep {...} ~> map {...} ~> sort ~> @out;
> > > 
> > > That's going to be just plain confusing. Arguments to functions
> are
> > supposed
> > > to be on the right. And what's up with using them for assignment?
> That's
> > > making them even more overcomplicated and ugly. Do you care about
> > readability
> > > at all? It seems to me that ~> and <~ have no use except making
> perl 6
> > uglier
> > > and more complicated than it already is. They're completely
> unnecessary.
> > 
> > 1) "Arguments to functions are supposed to be on the right." 
> > 
> > Hmmm. If you use a mathematical context, I guess "supposed to"
> could be
> > code
> > for "I've always done it that way". But certainly not "supposed to"
> in any
> > cosmic sense. 
> > 
> > But what The Damian is proposing is much more like a Unix pipeline
> than
> > mathematics.
> >      @a ~> grep {...} ~> map {...} ~> sort ~> @out;
> > makes much more sense when you see it as being much more akin to
> >      cat a | grep ... | tr ... | sort > out
> > than
> >      let out = sort(map {...} (grep {...} @a))
> > No, it's not like the math that is one of Perl's influences. It's
> like the
> > Unix shells, which is another of Perl's influences.
> 
> It's not letting you do anything that you couldn't do before with
> normal
> function calls and assignment.

Actually, this is false. The notion of directional pipeline operators
immediately begat two children, to wit:

1- The notion of simultaneous, synchronous execution of pipes, as in:

a ~> b ~> m <~ y <~ z;

Which people have sort of backed away from, but I think there still
might be something there, even if I can't personally set it yet.

2- It also (re) introduced the conceptual framework of unix pipes,
which immediately led to the (IMO: really good) suggestion of a "tee"
mechanism:

   widget ~| expr a ;
          ~| expr b ;
          ~| expr c ;

And that one, I think, conceals a whole boatload of conceptual power. 

So to me the pipeline operators are kind of like the ?: operator --
true, you don't need it (you could use C<if>) but it enables other
things. Except in this case it might enable some really cool things.

And don't worry about the ~> syntax looking awkward. We'll probably
convert it to a Unicode special character in production :-) :-) :-).

=Austin

Reply via email to