RosettaCodeData/Task/Add-a-variable-to-a-class-i.../Raku/add-a-variable-to-a-class-i...

5 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