Documentation for method parents
assembled from the following pages:
Role: Metamodel::MultipleInheritance §
From Metamodel::MultipleInheritance
(Metamodel::MultipleInheritance) method parents §
method parents(, :, :)
Returns the list of parent classes. By default it stops at Cool, Any or Mu, which you can suppress by supplying the :all
adverb. With :tree
, a nested list is returned.
; is D ; is D ; is C1 is C2 ; is B ; say A.^parents(:all).raku;# OUTPUT: «(B, C1, C2, D, Any, Mu)» say A.^parents(:all, :tree).raku;# OUTPUT: «[B, ([C1, [D, [Any, [Mu]]]], [C2, [D, [Any, [Mu]]]])]»