RosettaCodeData/Task/Reflection-List-properties/Raku/reflection-list-properties.raku
2023-07-01 13:44:08 -04:00

11 lines
224 B
Raku

class Foo {
has $!a = now;
has Str $.b;
has Int $.c is rw;
}
my $object = Foo.new: b => "Hello", c => 42;
for $object.^attributes {
say join ", ", .name, .readonly, .container.^name, .get_value($object);
}