Skip to content

Instantly share code, notes, and snippets.

Created August 5, 2015 17:00
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 anonymous/0a3088ffb1f46aee7928 to your computer and use it in GitHub Desktop.
Save anonymous/0a3088ffb1f46aee7928 to your computer and use it in GitHub Desktop.
use v6;
class A does Positional {
subset A::Value where { $_ ~~ /^<[a..z]>$/ }
has @!a_values handles Positional;
method new (*@values) { self.bless(a_values => @values) }
submethod BUILD (:@!a_values) {}
}
my $o = A.new('foo', 'bar');
say $o.elems;
say $o.join(',');
say $o;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment