RosettaCodeData/Task/Add-a-variable-to-a-class-instance-at-runtime/Perl-6/add-a-variable-to-a-class-instance-at-runtime-2.pl6
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

4 lines
159 B
Raku

my $lue = 42 but role { has $.answer = "Life, the Universe, and Everything" }
say $lue; # 42
say $lue.answer; # Life, the Universe, and Everything