> No method called for a variable, for an object referred by 'a'.

Sorry, I didn't describe it so well.  I meant that the equivilent of
'a.initialize' is executed.  It is as you say, the object instance that
recieves the 'initialize' method call.

> Still the object referred by 'a' may exist.

The intention is that calling 'a.destroy' would kill the object that 'a'
referred to, after calling some 'uninitialize' method for the object. 'a'
would now be a reference to Nil.

I can see how this would cause problems because some variables may still
point to the object that has been killed.  It would be possible for the
runtime to recognize ptr's to killed objects and treat them accordingly by
changing the ptr to Nil.

class MyClass
    def uninitialize
        p "Uninitializing"
    end
end

a = MyClass.new
b = a

p a.class                            => MyClass
p b.class                            => MyClass

a.destroy                            => "Uninitializing"

p a.class                            => NilClass
p b.class                            => NilClass

Even so, I think such a feature would raise a lot of issues and I think it
would be better for objects to finalize the moment that they have no other
references to them.

--
Justin Johnson
justinj / mobiusent.com
Technical Director
Mobius