Skip to content

Instantly share code, notes, and snippets.

Created August 3, 2015 12:41
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/4d6c3cff038c4b3131bd to your computer and use it in GitHub Desktop.
Save anonymous/4d6c3cff038c4b3131bd to your computer and use it in GitHub Desktop.
use v6;
class A {
has @!a;
method new () {
my $obj = self.bless;
$obj!a = 1,2,3;
$obj;
}
}
my $o = A.new;
say $o;
@jonathanstowe
Copy link

use v6;

class A {
has @!a;
method new () {
my $obj = self.bless(a => [1,2,3]);
$obj;
}
submethod BUILD(:@!a) { }
}

my $o = A.new;
say $o.perl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment