Thread View: comp.lang.objective-c
2 messages
2 total messages
Started by Simson L. Garfinkel
Mon, 03 Dec 1990 19:46
promotion
Author: Simson L. Garfinkel
Date: Mon, 03 Dec 1990 19:46
Date: Mon, 03 Dec 1990 19:46
4 lines
564 bytes
564 bytes
Is there any way to change the class of an object? That is, to change it from class A to a subclass of A? ................................................................simson
Re: promotion
Author: Greg Franks
Date: Wed, 05 Dec 1990 15:46
Date: Wed, 05 Dec 1990 15:46
27 lines
1866 bytes
1866 bytes
In article <4252@media-lab.MEDIA.MIT.EDU> simsong@media-lab.MEDIA.MIT.EDU (Simson L. Garfinkel) writes: >Is there any way to change the class of an object? That is, to change >it from class A to a subclass of A? If you are willing to fileOut and fileIn the object, the answer is yes. The technique is a bit tricky, but we have done it here as our application has evolved. First, save the object using the old class hierarchy with fileOut:. Then, massage the ascii filer record to correspond to the new definition of the class (the easiest way to perform this operation is file out an instance of the new definition of the class then compare it against the old definition). Finally, fileIn the massaged version of the object. Presto... converted object (we do this operation on-the-fly by saving a "version number" in the filer output and calling a few methods to automagically massage records if the saved version does not match the current version). You will likely find lots of bugs in the filer :-(. If you want to mutate an object while the program is running -- I'm afraid that I cannot help -- we haven't tried to do that (yet :-). Seasons greetings... -- Greg Franks, (613) 788-5726 | "The reason that God was able to Systems Engineering, Carleton University, | create the world in seven days is Ottawa, Ontario, Canada K1S 5B6. | that he didn't have to worry about greg@sce.carleton.ca ...!cunews!sce!greg | the installed base" -- Enzo Torresi
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads