4 ms·
You can always add `is ro` trait modifier. multi sub trait_mod:<is> (Attribute:D $attr, :$ro!) { # no need to do anything, because this is the defaul
by b2gills 8y ago
You can always add `is ro` trait modifier.
multi sub trait_mod:<is> (Attribute:D $attr, :$ro!) {
# no need to do anything, because this is the default
}
class Pointer {
has $.x is ro;
has $.y is rw;
}
That is assuming you aren't fine with using `is readonly`.
class Pointer {
has $.x is readonly;
has $.y is rw;
}
Which works better with the trait mod `is required`
class Pointer {
has $.x is readonly is required;
has $.y is rw;
}