Skip to content

Instantly share code, notes, and snippets.

@viklund
Created June 30, 2009 10:29
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 viklund/138104 to your computer and use it in GitHub Desktop.
Save viklund/138104 to your computer and use it in GitHub Desktop.
use v6;
enum TG <B C D>;
class A { }
my $a1 = A.new( ) but B;
my $a2 = A.new( ) but C;
for $a1, $a2 {
when TG::B { say 'b' }
when TG::C { say 'c' }
when TG::D { say 'd' }
default { say 'nope' }
}
# vim: ft=perl6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment