prototypes addSlot: #MOP valued: Namespace derive. MOP addSlot: #MetaObject valued: Derivable derive. MOP MetaObject addSlot: #target valued: Root. MOP MetaObject addSlot: #slots valued: Set newEmpty. "The Collection of slot definition objects describing the object's slots." MOP MetaObject addSlot: #roles valued: Set newEmpty. "The Role objects referring to methods and annotated with the positions relevant for the object." MOP MetaObject addSlot: #delegates valued: ExtensibleSequence newEmpty. "The actual objects delegated to, in their precedence order. So new delegates would be addFirst:ed." mo@(MOP MetaObject traits) delegationOrder "Returns a Sequence of the objects that the target delegates to, in the order of method-applicability precedence. The order should be depth-first search in reverse order of delegation slot addition." [| result delegates | (delegates: mo delegates) isEmpty ifTrue: [^ {}]. result: {}. delegates do: [| :each | result: result ;; each ;; each delegationOrder]. result "balanced" ]. mo@(MOP MetaObject traits) newEmpty [| newMO | newMO: mo clone. newMO target: Nil. newMO slots: mo slots newEmpty. newMO delegates: mo delegates newEmpty. newMO roles: mo roles newEmpty. newMO ]. obj@(Root traits) meta [ MOP MetaObject for: obj ]. mo@(MOP MetaObject traits) for: obj@(Root traits) [| newMO | newMO: mo newEmpty. newMO ].