This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: using gcj for a different language - is it possible?
Per Bothner writes:
> Andrew Pinski wrote:
>
> >> And does Objective-C support operations like #become: (switching the
> >> identities of two objects)?
> >
> > If you mean something like -PoseAs: which changes class types at
> > runtime, yes.
> > If that is not what you mean then can you help out here and explain what
> > really
> > #become does?
>
> 'a become: b' swaps object identity.
> After the become all references that used to point to the
> object references by a now point to the object that used to
> be referenced by b.
>
> This isn't really practical to support unless you use indirection
> via an object table, which Objective-C doesn't.
I think the trick used in Smalltalk was to copy and then overwrite
both objects with a special indirection object. We could do this in
gcj.
Andrew.