Re: The pipe's sharp end

Skip to first unread message

Luke Palmer

May 6, 2005, 7:17:48 AM5/6/05
to Brad Bowman, perl6language
On 5/6/05, Brad Bowman <> wrote:
> Hi,
> <$*IN> ==> process() ==> print;
> This A06 example got me thinking.
> Could non-variadic subrountines in a pipeline be useful?
> A single arg sub or block could be a map without the "map":
> <$*IN> ==> &process ==> print;
> # print map { process($_) } <$*IN>
> (1..6) ==> { $_++ } ==> say;

Hmm. Well, considering that that is the same as:

(1..6) ==> map { $_++ } ==> say;

And in fact, you can just slap map in front of anything you want to do
that, I don't think we're buying much by letting you leave it off.
What if you give it a 1-ary sub that you thought was slurpy, and in
fact does something different (hmm, that doesn't seem very likely).
How do we handle options and the like?

Still, semantics like that are dwimmery, and the pipe operators are as
yet non dwimmy, so we'd be paying a price. Is that more or less than
three characters (when the pipe operators are already three

Also, as you point out below, the semantics are less than obvious for
subs with arity > 1. So it would be tough to figure out what IM


Reply all
Reply to author
0 new messages