13 lines
263 B
Text
13 lines
263 B
Text
|
|
prototypes define: #MyPrototype &parents: {Cloneable} &slots: #(instanceVar).
|
||
|
|
MyPrototype traits addSlot: #classVar.
|
||
|
|
|
||
|
|
x@(MyPrototype traits) new
|
||
|
|
[
|
||
|
|
x clone `>> [instanceVar: 0. ]
|
||
|
|
].
|
||
|
|
|
||
|
|
x@(MyPrototype traits) someMethod
|
||
|
|
[
|
||
|
|
x instanceVar = 1 /\ (x classVar = 3)
|
||
|
|
].
|