RosettaCodeData/Task/Add-a-variable-to-a-class-instance-at-runtime/Raku/add-a-variable-to-a-class-instance-at-runtime-2.raku
2023-07-01 13:44:08 -04: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