3 ms·
Ah, ok - I misinterpreted the article. Actually, the article seems to be wrong? It seems to imply that this shouldn't work: Io> x := Object clone do( forw
by vito 16y ago
Ah, ok - I misinterpreted the article.
Actually, the article seems to be wrong? It seems to imply that this shouldn't work:
Io> x := Object clone do( forward := 0; a := 1 )
==> Object_0x1003a2e90:
a = 1
forward = 0
Io> x a
==> 1
Io> x b
==> 0
Io> x b := 2
==> 2
Io> x b
==> 2
(paragraph: There are some things you should know about forward(). It's very powerful. Too powerful. [...])
- draegtun 16y agoNot sure what the article is referring to there? As far as I know you would have to amend the objects protos or overwrite the setSlot message (which := is an alias for) to change this behaviour. The documentation clearly states for forward that: If an object doesn't respond to a message, it will invoke its "forward" method if it has one.