##
class c {
has $!lb;
#| Auto-generated if there's no explicit `lb` method:
method lb { $!lb }
}
##
##
class c { has $.lb is rw; } # note the `is rw`
##
##
class c {
has $!lb;
#| Auto-generated if there's no explicit `lb` method:
method lb is rw { $!lb } # note the `is rw`
}
##
##
my $container;
class c {
#| `is rw` means return the container, not its value
method m is rw { $container }
};
my $o = c.new;
$o.m = 6;
say $container # prints `6`, the container's contents