Skip to content

Instantly share code, notes, and snippets.

@mcmillhj
Created December 9, 2021 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcmillhj/a54ea1515cab011b3000e8ae81218f74 to your computer and use it in GitHub Desktop.
Save mcmillhj/a54ea1515cab011b3000e8ae81218f74 to your computer and use it in GitHub Desktop.
Raku set question
my @sets = <ab bc cd>.map: { .comb.Set };
my $first = @sets.first({ $_ (==) <a b>.Set });
my $second = @sets.first({ $_ (==) <b c>.Set });
my $last = @sets.first({ $_ != <a b>.Set && $_ != <b c>.Set });
say [$first, $second, $last];
# outputs
# [Set(a b) Set(b c) (Any)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment