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

Simon,

It is a great pleasure for me to hear that I was able to help.

What is regarding quote from Bc.Containars.Lists it sounds quite natural for
me.
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.).
When applying Clear function to the list it deletes nodes in the chain
denoted  only by the list to which this function was applied. Any object
that is referenced by any node in this particular chain is deleted only if
it is not referenced form any other structure to which it may belong. It is
also possible that the same object may referenced by the different elements
of the same list. This is extremely flexible. Such flexibility is achieved
through the use of controlled types.
To me this is absolutely right approach.
As BC is free software in ADA it is possible to build something  more
complicated based on it or use it as software patterns which may be easily
modified for particular needs.

As a matter of fact I am not software engineer. I am radio-electronic system
engineer (all kind of systems) so I am doing some programming when I need to
do it for some particular purpose and also for my pleasure.
If there are some specific question regarding BC you can ask Simon Wright
 simon@pogner.demon.co.uk ) who is maintaining it.


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



Simon Wright wrote in message ...
>"news.oxy.com" <Vladimir_Olensky@oxy.com> writes:
>
>> Have a look at the ADA95 implementation of the Booch components
>>  http://www.pogner.demon.co.uk/components/bc/ ).
>> Everything is already at hand (including all types of  linked lists).
Just
>> use it. Also this is very good example of ADA95 programming.
>
>Thanks for that, Vladimir! (from me and the team)
>
>One small point, which I'm not sure how to address; the BCs have a
>perhaps surprising take on manipulating lists.
>
>The following comment is a direct transliteration of the C++ words
>(and it shows in places!  "member function" indeed ..):
>
>  -- Unreachable items are those that belong to a list or a sublist whose
>  -- head is not designated by any alias. For example, consider the list (A
>  -- B C), with the head of the list designated by L1. L1 initially points
>  -- to the head of the list, at item A. Invoking the member function Tail
>  -- on L1 now causes L1 to point to item B. Because A is now considered
>  -- unreachable, the storage associated with item A is reclaimed; the
>  -- predecessor of B is now null. Similarly, consider the list (D E F),
>  -- with the head of the list designated by both L1 and L2. Both L1 and L2
>  -- are aliases that initially point to the head of the list at item
>  -- D. Invoking the member function Tail on L1 now causes L1 to point to
>  -- item E; L2 is unaffected. Suppose we now invoke the member function
>  -- clear on L2. The semantics of this operation are such that only
>  -- unreachable items are reclaimed. Thus, the storage associated with
>  -- item D is reclaimed, because it is no longer reachable; L2 is now
>  -- null, and the predecessor of E is now null. Items E and F are not
>  -- reclaimed, because they are reachable through L1.
>
>I think this is not in fact that far from a Lisp approach, but at
>least one user has been bitten by it (not helped by there being an
>effor which meant that parts of the list were sometimes reachable when
>they shouldn't have been).
>
>STk> (define foo '(a b c))
>STk> (define bar foo)
>STk> (set! foo (cdr foo))
>STk> foo
>(b c)
>STk> bar
>(a b c)
>
>Of course, there's no easy equivalent of the doubly-linked list ..






  reply	other threads:[~1999-01-20  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 [this message]
1999-01-21  0:00       ` Simon Wright
1999-01-21  0:00         ` news.oxy.com
  -- 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