Does anything special happen to objects when there are no variables pointing to them any more? Apart from being eligible for garbage collection, that is.
For example, currently, IO objects automatically close when they're garbage collected, if they haven't done so already. Even if you wanted to change this behavior, there isn't any way of changing it so that automatic closing occurs when no more variables point at the object, is there?
(My question is a slight simplification: WeakRef allows variables to point to objects and for them to be targets of garbage collection. Also, it's possible to access objects that don't have any variables pointing to them, for some implementations of Ruby, by using ObjectSpace. And regarding IO objects, there's things like IO.open(&block)
that automatically close IO objects after the block has been executed.)