RosettaCodeData/Task/Add-a-variable-to-a-class-instance-at-runtime/Perl-6/add-a-variable-to-a-class-instance-at-runtime-3.pl6
2015-11-18 06:14:39 +00:00

5 lines
156 B
Raku

use MONKEY-TYPING;
augment class Int {
method answer { "Life, the Universe, and Everything" }
}
say 42.answer; # Life, the Universe, and Everything