3 ms·
map, grep and join are subs as well as methods. Perl6 is a multi-paradigm language and of course there's more than one way to do it - even when using the same o
by cygx 14y ago
map, grep and join are subs as well as methods. Perl6 is a multi-paradigm language and of course there's more than one way to do it - even when using the same operations.
Instead of chaining methods, one could also use
# p5 style
join "\n", grep ?*, map *.description, @list;
# dataflow style
@list ==> map *.description ==> grep ?* ==> join "\n";
join "\n" <== grep ?* <== map *.description <== @list;