🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #3476

Re: CHALLENGE: heterogeneous collections

#3476
From: Peter Goodall
Date: Tue, 26 Mar 1991 22:20
32 lines
2014 bytes
brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:

> ...
>So: What use can anyone make of a heterogeneous list?

>---Dan

I have written a Smalltalk application which will unload fairly arbitary
recursive objects to an append only Stream (pipe). We use this for
spitting windows and their contents between workstations on a network.
There is no way of knowing the contents of a window structure 
because they are very dynamic.

When I write the structure out to a file I keep a heterogeneous Dictionary
which has as keys each object encountered as the structure is traversed.
The valu in the dictionary at an object is a unique number from a counter.

So, if I find a new object, I increment the counter and store its value
in the dictionary at the new object. Each time I encounter an object in
the traversal I check the dictionary if it is already there I put its
unique integer in the output stream.

When I load a structure from a stream into the curent image I put each object
as I re-create it into a heterogeneous list. It's index in this list
is the unique number assigned in the output dictionary. When I encounter
a reference number on input replace it with inputListAt: anInteger.

While the structure of this text may not be too good. I believe this is 
an application where heterogeneous maniplulation of objects is essential.


Peter Goodall
Technical Details
Message-ID: <objtch.670026043@extro>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!lethe!tvcent!comspec!telly!attcan!uunet!munnari.oz.au!metro!extro!objtch
References: <jls.669591628@rutabaga> <1991Mar22.210725.29448@neon.S <1991Mar25.220525.11087@leland.Stanford.EDU> <26714:Mar2602:52:1891@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!lethe!tvcent!comspec!telly!attcan!uunet!munnari.oz.au!metro!extro!objtch
From: objtch@extro.ucc.su.oz.au (Peter Goodall)
Newsgroups: comp.lang.misc,comp.object
Subject: Re: CHALLENGE: heterogeneous collections
Message-ID: <objtch.670026043@extro>
Date: 26 Mar 91 22:20:43 GMT
References: <jls.669591628@rutabaga> <1991Mar22.210725.29448@neon.S <1991Mar25.220525.11087@leland.Stanford.EDU> <26714:Mar2602:52:1891@kramden.acf.nyu.edu>
Sender: news@metro.ucc.su.OZ.AU
Organization: Sydney University Computing Service, Sydney, NSW, Australia
Lines: 32
Nntp-Posting-Host: extro.ucc.su.oz.au