RosettaCodeData/Task/Add-a-variable-to-a-class-instance-at-runtime/Raku/add-a-variable-to-a-class-instance-at-runtime-3.raku

6 lines
156 B
Raku
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
use MONKEY-TYPING;
augment class Int {
method answer { "Life, the Universe, and Everything" }
}
say 42.answer; # Life, the Universe, and Everything