Skip to content

Instantly share code, notes, and snippets.

@gfldex
Created August 29, 2016 23:04
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 gfldex/af2a861fc216b732d4eab5a944146c62 to your computer and use it in GitHub Desktop.
Save gfldex/af2a861fc216b732d4eab5a944146c62 to your computer and use it in GitHub Desktop.
use v6;
enum Noms(<Greenstuff Walkingstuff Syntetics>);
(my %eaten{Noms} is default(0)) does role :: {
method keys { Noms::.values }
method kv { gather for self.keys -> \k { take k, self.{k}} }
};
%eaten{Greenstuff}++;
dd %eaten, %eaten.keyof, %eaten.keys;
dd %eaten.kv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment