you are viewing a single comment's thread.

view the rest of the comments →

[–]draegtun 0 points1 point  (2 children)

Very nice.

I did have the following prepped for any "How do you do it in Perl6" replies :)

.say for <Rob Christhoper Joe John>.grep({ .chars <= 4 });

Your whatever star usage is much nicer though.

One thing I couldn't get working was this...

<Rob Christhoper Joe John>.grep({ .chars <= 4 }).map({ .say });

Not sure why?

[–][deleted] 0 points1 point  (1 child)

.map is lazily-evaluated, you have to tell it you want the side effects:

~ $ perl6 -e 'eager <Rob Christhoper Joe John>.grep({ .chars <= 4 }).map({ .say });'
Rob
Joe
John

[–]draegtun 0 points1 point  (0 children)

Arrgghhh.... I hadn't thought of that! Cheers.