See Original text in context
method required(Attribute: --> Any)
Returns 1
for attributes that have the "is required" trait applied, or Mu
if the attribute did not have that trait applied. If the "is required" trait is applied with a string, then that string will be returned instead of 1
.
my = Library.^attributes(:local)[0];my = Library.^attributes(:local)[1];say .required; # OUTPUT: «1»say .readonly; # OUTPUT: «"we always need more books"»