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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ce0900b60ca3f616 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-09 10:13:20 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!proxad.net!feeder2-1.proxad.net!news1-1.free.fr!not-for-mail Newsgroups: comp.lang.ada Subject: Re: List container strawman References: <3BE29AF4.80804@telepath.com> <3BE29BD4.10401@telepath.com> <3BE2DB99.B707D409@boeing.com> <3BE32A18.18404AD1@boeing.com> <3BE443DE.574D669C@acm.org> <3BE58FDD.E1FB1815@san.rr.com> From: Jean-Marc Bourguet Date: 09 Nov 2001 19:13:16 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <3bec1cbe$0$15824$626a54ce@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 09 Nov 2001 19:13:18 MET NNTP-Posting-Host: 158.140.208.29 X-Trace: 1005329598 news1-1.free.fr 15824 158.140.208.29 X-Complaints-To: abuse@proxad.net Xref: archiver1.google.com comp.lang.ada:16157 Date: 2001-11-09T19:13:18+01:00 List-Id: Ted Dennison writes: > In article , ramatthews@tinuviel.com says... > > In article , Kilgallen@SpamCop.net > >(Larry Kilgallen) wrote: > >> In article <3BE58FDD.E1FB1815@san.rr.com>, Darren New > >>writes: > >> > >>> If you really want it to be foolproof, > >> Yes please. > > > > > >While I see a foolproof list does not have universal appeal I have been > >successfully using one for some time so I thought its specification would > >help discussions. > > Yup. That does exactly what is needed to make it safe. I never said it was > impossible, just that its a lot of work, inculding some extra runtime work > that might not endear the facility to real-time users. One problem is that > creating an iterator with this facility involves dynamic allocation and > linked-list traversal. Why do you need dynamic allocation. The pointer can be in the iterator and put at the start of the list. As most lists have few iterators and when they have more than one, a majority of the uses are nested the list traversal will be done only on list modifications. > That violates our general principle of avoiding > runtime vs. setup overhead, but that could probably(?) be fixed or at least > avoided by the user if noted. Another issue is that it puts a controlled > type in the generic package, which I was trying to avoid so that it was > instantiateable at lower levels. However, it turned out that List has to > be controlled anyway, so perahps this isn't so bad. > > I'm interested in what the general consensus is here. Should we do the > extra work to make iterators safe, given that this will have at least the > following effects: I'm for. > o Add extra dynamic memory operations to any list modification (there were > some there already). I don't think so. > o Add a (usually small) internal list traversal to any element > deletion. Agree. > o Add a small validity check (or possibly two) to every iterator > operation. Agree. > o Possibly make iterator creation non-determistic (time-wise). I don't think so. (Iterator deletion would be made non deterministic if they are assigned in a non nested way and the iterator list is a singly linked one). > o Possibly make iterator assignment non-deterministic. Not if the iterator list is doubly linked. -- Jean-Marc