From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2510538eb4348710 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-04 09:50:53 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: A generic list package Date: 04 Sep 2001 12:42:54 -0400 Organization: NASA Goddard Space Flight Center Message-ID: References: <87ae0dp7gn.fsf@deneb.enyo.de> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 999621831 11821 128.183.220.71 (4 Sep 2001 16:43:51 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 4 Sep 2001 16:43:51 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:12708 Date: 2001-09-04T16:43:51+00:00 List-Id: Florian Weimer writes: > Stephen Leake writes: > > > > > I find it curious that you expect the client to provide the "next" > > field/operation, rather than declaring a Node_Type containing the > > user's type and a Next field. Can you elaborate on this? > > Using this approach, you can save one indirection in the case of > indefinite types. (The redirection seems necessary as well if you > need a non-constant view of the actual data.) In such cases, your > approach seems to result in the following: > > +-------------- ... > +------------------+ | > | o========#=======>>| actual data > | | | > | fields specific | +-------------- ... > | to the container | > +------------------+ > > > The getter/setter aproach permits the following: > > +------------------+ > | fields specific | > | to the container | > | | > | actual data | > . . > : : > > > And it is still possible to obtain a non-constant view of the actual > data. Yes. I have an indirection and cleaner abstraction; you have less clean abstraction and no indirection. I guess that's a useful tradeoff. > > Your approach leaves everything up to the user; mine ensures that > > garbage is collected appropriately, when necessary; the user only > > needs to provide the appropriate 'free' operation. > > I think our approaches are not much different in this regard; if an > element is removed from a list, it is also freed by my implementation. Ok, guess I missed that in your comments. -- -- Stephe