comp.lang.ada
 help / color / mirror / Atom feed
From: "news.oxy.com" <Vladimir_Olensky@oxy.com>
Subject: Re: Doubly linked list.
Date: 1999/01/21
Date: 1999-01-21T00:00:00+00:00	[thread overview]
Message-ID: <786ubk$jk8$1@remarQ.com> (raw)
In-Reply-To: x7vn23dmaxq.fsf@pogner.demon.co.uk


Simon Wright wrote in message ...
>"news.oxy.com" <Vladimir_Olensky@oxy.com> writes:
>
>
>> Bc implementation of doubly linked lists is a chain of nodes each
>> containing pointers to prev. and next nodes as well as reference to
>> the object denoted by that node (this object may be any kind of
>> object including list, tree ,buffer, queue e.t.c.). Such object may
>> belong to more than one list.  Moreover it may belong to any other
>> kind of structure (e.g. tree, list etc.).
>
>The BCs work by taking copies of things (the generic parameter Item is
>private), so to get the semantics you're talking about you need to use
>(smart) pointers.
>



Yes, I agree.

Function Create in BC.Suppor.Nodes makes a copy of the Item passed to it so
the node after creation contains a copy of the Item, which is aliased. This
means that the Node.Element, which is the copy of the Item, may be
referenced from somewhere else and in this case it should not be deleted by
Clear function. Proper behavior of the Clear function in this case should be
to delete the node belonging to the list do not touching it's Element. After
that Node.Elememt should continue to live as separate entity that does not
belong any more to the deleted list. Anyway I did not investigate this issue
so deep. May be someone who will be working with this more closely will
analyze the BC code and test this kind of things.

I was recently experimenting a little bit with controlled types and such
(smart)pointers which in turn are also controlled types so I was thinking
regarding above mentioned issues using such categories. As a matter of fact
it gives extreme level of flexibility to the BC structures.

Sorry for mixing together this two things and I am glad that you noted this
inconsistency.



Regards,
Vladimir Olensky (Vladimir_Olensky@oxy.com)
Telecommunication specialist,
Occidental C.I.S. Service, Inc. ( www.oxy.com )
Moscow,
Russia.










  reply	other threads:[~1999-01-21  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-15  0:00 Doubly linked list Matt Tyler
1998-12-15  0:00 ` Tucker Taft
1999-01-19  0:00 ` news.oxy.com
1999-01-19  0:00   ` Simon Wright
1999-01-20  0:00     ` news.oxy.com
1999-01-21  0:00       ` Simon Wright
1999-01-21  0:00         ` news.oxy.com [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-09-24 17:06 Doubly Linked List Robert Kitzberger
1993-09-24 13:32 John Lorenzen
1993-09-23 16:41 cis.ohio-state.edu!math.ohio-state.edu!caen!usenet.cis.ufl.edu!eng.ufl.ed
1993-09-22  0:24 George C. Harrison, N orfolk State University
1993-09-21  0:47 Gregory Aharonian
1993-09-20 15:14 David Tannen
1993-09-19 22:59 agate!howland.reston.ans.net!europa.eng.gtefsd.com!darwin.sura.net!seas.g
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox