From: Barry Margolin
Subject: Re: weak pointers?
Date: 
Message-ID: <ibeI6.8$Ip3.407@burlma1-snr2>
In article <··································@4ax.com>,
 <·······@hotmail.com> wrote:
>
>What are weak pointers or weak references? I think it has something to do with
>gc, but I'm not sure...

Weak references are references to an object that are ignored by the GC, If
the only references to an object are weak, the object is considered garbage
and may be collected.

This is mainly useful so that you can use tables as a way of maintaining
properties about an object and still allow that object to be GC'ed.  If
there are no references to the object other than as a key in the table,
then no one will be able to look up that key in the table (unless they
can reconstruct the object or enumerate the table's keys -- if your
application may do those, you obviously wouldn't use weak references), so
it should be safe for the GC to collect the object (and it may then also
clear the value reference).

-- 
Barry Margolin, ······@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.