I had implicitly touched on this in the past, but speaking of binops - and of functional features in Perl6, is there any provision of a (list associative?) composition binop?

I had naively thought about ==> and/or <==, but that's somewhat on a different level.

What I refer to now is something that takes two {coderefs,anonymous subs,closures} and returns (an object that behaves like) another anonymous sub, precisely the one that acts like the former followed by the latter (or vice versa!).

Optionally, (ab)using C<< ==> >> for it, if we have

my $composed = sub_1 ==> sub_2;

and sub_1 has a signature, and sub_2 has a returns trait, $composed should have the same signature as sub_1 and the same returns trait as sub_2. Also it should complain if sub_2 has a signature and sub_1 a returns trait and these do not match.

How 'bout this idea?

Michele -- L'amava come si ama qualcosa che e' necessario alla vita. La odiava come si odia chi tradisce. - Laura Mancinelli, "Gli occhi dell'imperatore"

Reply via email to