From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: A generic list package
Date: 04 Sep 2001 12:42:54 -0400
Date: 2001-09-04T16:43:51+00:00 [thread overview]
Message-ID: <usne2oqk1.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: tg7kvggsdg.fsf_-_@mercury.rus.uni-stuttgart.de
Florian Weimer <Florian.Weimer@RUS.Uni-Stuttgart.DE> writes:
> Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov> writes:
>
> <snip>
>
> > 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
next prev parent reply other threads:[~2001-09-04 16:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-02 22:13 A generic list package (long) Florian Weimer
2001-09-02 22:29 ` Stephen Leake
2001-09-03 9:53 ` Florian Weimer
2001-09-03 16:18 ` A generic list package Florian Weimer
2001-09-03 17:16 ` Jeffrey Carter
2001-09-04 9:40 ` Florian Weimer
2001-09-04 16:42 ` Stephen Leake [this message]
2001-09-18 14:58 ` Lutz Donnerhacke
2001-09-18 19:07 ` Simon Wright
2001-09-19 8:05 ` Lutz Donnerhacke
2001-09-19 19:45 ` Simon Wright
2001-09-20 8:21 ` Lutz Donnerhacke
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox