Perhaps this is -too- idiomatic, but for recipe 04-08 (You want to find elements in one array but not in another):
@aonly = gather { take when none(@b) for @a; };Though if when is considered a statement modifier in this case, and if you can't combine statement modifiers in p6 (much as you cannot in p5), then that likely doesn't work. In that case:
@aonly = gather { for @a { take when none(@b) }};For numeric @a, and $_ will these be equivalent:
( $_ == none( @a ) ) && say "foo"; ( $_ ~~ none( @a ) ) && say "foo";
In reply to Re: Perl6 Cookbook
by fishbot_v2
in thread Perl6 Cookbook
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |