Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.object,comp.lang.misc
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!EU.net!Norway.EU.net!nntp.uio.no!news.cais.net!nntp04.primenet.com!nntp.primenet.com!netcom.com!NewsWatcher!user
From: smryan@netcom.com (!@?*$%)
Subject: Re: Problems with returning lists as objects!
Message-ID: <smryan-1608962227090001@10.0.2.15>
Sender: smryan@netcom9.netcom.com
Organization: The Programmer formerly known as S M Ryan
References: <4v2cfe$hui@bagan.srce.hr>
Date: Sat, 17 Aug 1996 06:23:49 GMT
Lines: 20
Xref: glinda.oz.cs.cmu.edu comp.lang.c++:206910 comp.lang.smalltalk:42463 comp.object:54300 comp.lang.misc:26524

> How you could solve this problem in any of
> object language you know, or even in C++?

Yes, in Lisp over 30 years ago.


        union = \[a,b].[elemof[car[a],b] -> union[cdr[a],b];
                        true -> cons[car[a],union[cdr[a],b]]

        elemof = \[elem,list].[null[list] -> false;
                        equal[elem,car[list]] -> true; 
                        true ->elemof[elm,cdr[list]]]

It's called _automatic_ garbage collection.

-- 
In mirrored maze he met the Mother,        | smryan@netcom.com  PO Box 1563
the lost and breathless, lonely brother.   |          Cupertino, California
Both crone and child, now crying wild,     | (xxx)xxx-xxxx            95015
her clinging clay will clothe and smother. |         I don't use no smileys
