Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!news.sprintlink.net!noc.netcom.net!netcomsv!uu3news.netcom.com!netcomsv!uucp3.netcom.com!medicus!billf
From: billf@medicus.com (Bill Foote)
Subject: Re: ST/V Is there a way to implement a WeakArray ?
Message-ID: <1995Jun13.211405.28828@medicus.com>
Organization: Medicus Systems Corp.
References: <jconallen.13.00097C12@SunBelt.Net>
Date: Tue, 13 Jun 1995 21:14:05 GMT
Lines: 38

In article <jconallen.13.00097C12@SunBelt.Net> jconallen@SunBelt.Net (jim conallen) writes:
>I was told by some that VW has something called a weak array.  This array 
>is a collection of objects all of which are a dependent to some other object.  
>Once all dependencies go away on that object (except of course the one of the 
>weak array) the object is removed from the array and garbage collected.
>
>Is there such a concept in ST/V.  If so were?  If not, can it be built? 

Yes, there is, although in somewhat "beta" form (at least in the 3.x 
Enterprise version of Smalltalk/V for Win32, which is what I happen
to have on my desk.  I assume, however, that it's also a part of the
non-Enterprise version).

Quoting from a document given to me by Digitalk support:

    Weak Pointers

    This file contains a brief description of Weak Pointers.  Weak Pointers
    are a facility which is available in this release, but only as a 
    "prototype".  In this release, weak pointers are working but they have
    undergone minimal testing.  We expect weak pointers to be fully supported
    in a future release, although the public prototol for weak pointers
    may change from what is offered in this "prototype".

There should be a file called vweak3a.sll somewhere (in extras, I presume)
that gives some examples of the use of weak pointers.

Digitalk's Smalltalk also has similar "prototype" support for finalization.

I haven't used either of these facilities yet, but from a cursory overview
they look OK.  I for one was very happy to find weak reference/finalization
support (if only in "prototype" form) because of the nice sorts of caching
things you can do with it.
--
Bill Foote                | Adde parvum parvo magnus acervus ecrit.
billf@medicus.com         | [Add little to little and there will be a big pile]
Medicus Systems           |    -- Ovid, via Frederick P. Brooks, Jr.
Alameda, CA USA           |
