Object subclass: Node [
|value|
new [
Transcript show: 'Test'.
value := 6.
]
getValue [
^value.
]
set:sth [
value := sth.
]
]
|data|
data := Node new.
Transcript show: (data getValue) printString ; cr. "nil"
data set:5.
Transcript show: (data getValue) printString. "5"
The problem is that a new
method is never called, so I can not set values or call initialize function. Moreover after something like that:
object := Node new. "Not called"
object new. "Here is called"
the method is called. How to fix that?