RosettaCodeData/Task/Add-a-variable-to-a-class-instance-at-runtime/Perl-6/add-a-variable-to-a-class-instance-at-runtime-3.pl6

6 lines
156 B
Raku
Raw Permalink Normal View History

2015-11-18 06:14:39 +00:00
use MONKEY-TYPING;
2013-04-10 22:43:41 -07:00
augment class Int {
method answer { "Life, the Universe, and Everything" }
}
say 42.answer; # Life, the Universe, and Everything