See Original text in context
method readonly(Parameter: --> Bool)
Returns True
for read-only parameters (the default).
my Signature = :(Str is rw, Bool :);say .params[0].readonly; # OUTPUT: «False»say .params[1].readonly; # OUTPUT: «True»
See Original text in context
method readonly(Attribute: --> Bool)
Returns True
for readonly attributes, which is the default, or False
for attributes marked as is rw
.
my = Library.^attributes(:local)[0];my = Library.^attributes(:local)[1];say .readonly; # OUTPUT: «True»say .readonly; # OUTPUT: «False»