#new
must be defined on Node class
to work:
Object subclass: Node [
|value|
getValue [
^value.
]
set: sth [
value := sth.
]
]
Node class extend: [
new [ | node |
Transcript show: 'Test'.
node := (super new).
node set: 6.
^ node
]
]
Note that value
cannot be accessed from #new
in this case, so the setter must be called