For some reason, I was thinking that there was a way to change the class of an object, but I can't seem to find it. Is there such a thing? I would like to mutate an instance of one class into an instance of another class without changing it's OOP. Presumably the instance size and type of both classes should be the same for this to work.
The key phrase is: "without changing it's OOP." I want to avoid a costly become:.
Stephen -
As far as I know, there's now way to do this without changing the oop. There is no control over what oop you get when you create a new object. I can think of only 3 ways to go:
1. Write a primitive that does this.
2. Figure some truly nasty way of doing this that will stop working as soon as the security team gets farther along with their work.
3. Use become. I know it takes time (3ms in a 20Mb image of mostly pointers on a 400MHz Mac), but you can also do many of them at once.
- Dan
Stephen -
As far as I know, there's now way to do this without changing the oop. There is no control over what oop you get when you create a new object. I can think of only 3 ways to go:
Write a primitive that does this.
Figure some truly nasty way of doing this that will stop
working as soon as the security team gets farther along with their work.
- Use become. I know it takes time (3ms in a 20Mb image of
mostly pointers on a 400MHz Mac), but you can also do many of them at once.
- Dan
Ok, I'm not sure if #2 applies to #1 or not...but if I wanted to pursue #1, what about security should I be aware of so that it will work when the security stuff comes available?
- Stephen
P.S. This security stuff sounds neat...any more info on where that's headed?
squeak-dev@lists.squeakfoundation.org