Adam D. Lopresto wrote:
Looks to me like with a few appropriate methods, you have left-to-right
ordering for free.
(@foo, @bar) := @a
. grep { $_ > 0}
. sort { $^b <=> $^b }
. part [/foo/, /bar/];
Yes indeed.
Of course, that means that grep and sort and part are all methods of the Array
class, so the standard way to write them would be
grep @a: {$_ > 0};
instead of
grep {$_ > 0} @a;
There's no reason that C<grep> couldn't be both a method and a builtin.
Hmmmm. Odd. I'm guessing it wouldn't be possible to extend the indirect
object syntax to allow
grep {$_ > 0} @a:;
It's *technically* possible (see Lingua::Romana::Perligata for example ;-)
It may or may not be *culturally* possible.
Damian