|
|
|
|
|
by readthenotes1
70 days ago
|
|
Mine was someObject.changeToClassOf(SomrOtherClass); (or something like that--i'm was long ago). In Smalltalk, changing an object's class preserves instance variable (attribute) values when possible, silently dropping if not, and gives it an SomeOtherClass's inheritance (and method dictionaries as a result). It forced me to realize that an instance of a class wasn't permanently coupled to be an instance of the class that instantiated it or even its current class |
|