Mr. Nobody wrote:

I don't like either of these operators. What's wrong with
>
>      @out = sort map {...} grep {...} @a
>
> ?

For a start, if these functions were to become (only) methods in Perl 6,
it would have to be:

       @out = sort map grep @a: {...} : {...} :;

And even if we do have both functional and methodical versions, this:

       @out <~ sort <~ map {...} <~ grep {...} <~ @a;

is still clearer in its intent than:

       @out = sort map {...} grep {...} @a;

And the squiggly version is also reversible, for those who are more
comfortable with reading left-to-right.

       @a ~> grep {...} ~> map {...} ~> sort ~> @out;

Plus we get a "tee" functionality from unary ~>.


Damian


Reply via email to