[self-interest] Does Self have become:
water at tunes.org
Tue Jun 22 05:43:13 UTC 2004
However, that solution masks the fact that the _AddSlots: call may
require the automatic memory allocator to re-allocate the object and
perform pointer forwarding (through tables, or whatever).
At least in Squeak, the implementation I'm most familiar with,
become:/becomeForward: are just re-using that machinery; perhaps
wrongly, since calls to those force GC's, but that seems to be a Squeak
quirk rather than a general logical condition. I don't mind exposing
that functionality, being an open-implementation proponent, at least at
In any case, this kind of idiom is certainly needed, it's just a
question of whether to expose VM functionality or re-create it via
combining other primitives in a library method.
On Jun 21, 2004, at 5:55 PM, Jecel Assumpcao Jr wrote:
> On Monday 21 June 2004 21:31, Michael Latta wrote:
>> The subject says it all. Does Self have the equivalent of "become:"?
> No, but it doesn't really need it. Note that there are two different
> flavors of #become: in the Smalltalk world - the swapping version and
> the forwarding version (if that is the right term).
> The equivalent of the non-swapping version can easily (but not
> efficiently) done as
> a _RemoveAllSlots.
> a _AddSlots: b.
> The swapping version is just a little more complicated.
Brian T. Rice
LOGOS Research and Development
More information about the Self-interest