Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Last active July 5, 2018 03:13
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 zoffixznet/aaadf78817352bad377f824ae76e964c to your computer and use it in GitHub Desktop.
Save zoffixznet/aaadf78817352bad377f824ae76e964c to your computer and use it in GitHub Desktop.
2018.05.122 zoffix@VirtualBox~/R/rakudo (master)$ cat ../z.p6
my (\t1, \t2) := $?FILE.IO.sibling('c.md').IO.slurp.split("\n\n").map: {
.trim.split(/\s*\,\s*/).Set
}
dd t1.Str.contains: 'Warring';
dd t2.Str.contains: 'Warring';
say "Got {+t1} elements in first set and {+t2} elements in second set";
say t1 > t2 ?? "First set has these extra elements: {sort keys t2 ∖ t1}"
!! t1 < t2 ?? "Second set has these extra elements: {sort keys t1 ∖ t2}"
!! "Two sets are exact"
2018.05.122 zoffix@VirtualBox~/R/rakudo (master)$ ./perl6 ../z.p6
Bool::True
Bool::False
Got 43 elements in first set and 44 elements in second set
Second set has these extra elements: David Warring
2018.05.122 zoffix@VirtualBox~/R/rakudo (master)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment