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=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,842accb6a7d76669 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-05 12:01:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!hub1.nntpserver.com!news-out.spamkiller.net!propagator-la!news-in-la.newsfeeds.com!news-in.superfeed.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <3BE301D1.4010106@telepath.com> <3BE5AB8F.681577D0@free.fr> Subject: Re: List container strawman 1.1 Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Mon, 05 Nov 2001 15:00:47 EST Organization: http://www.newsranger.com Date: Mon, 05 Nov 2001 20:00:47 GMT Xref: archiver1.google.com comp.lang.ada:15837 Date: 2001-11-05T20:00:47+00:00 List-Id: In article <3BE5AB8F.681577D0@free.fr>, Jean-Marc Bourguet says... >First, what's the semantic of assignation and of the equality test ? Since each element is copied into the list (rather than pointed to), then assignment would make a new list that contains copies of all the elements in the first list (in the same order). Equality probably should be the result of "and"ing the equality test on all elements in both lists. However, that doesn't seem too horribly useful to me, so perhaps "=" could get put in the private section if people have a problem with that. >It is not hard: the list can have a list of iterators and mark some invalid >when deleting an element or when going out of existance. Then using an >invalid iterator would raise an exception (Next, Previous could be make to >work). Having a Is_Valid function testing the validity of the iterator >could be nice. That's pretty much what would have to be done. You missed the fact that the iterators would have to be made controlled, with pointers back to the parent List, so that they can remove themselves when they go out of scope or get deallocated. Doing all that work for a such a minor safety gain doesn't seem to be a big win for me. Additionally, implementing a list inside of our cannonical list just rubs me the wrong way. Thus I'd vote against trying to make it "safe", as long as the possible issues are clearly documented. >A procedure to set the item as well as to get it could also be nice. You can perform a Remove followed by an Insert, which would do roughly the same thing. I suppose an "Assign" would save you a call, plus whatever dynamic allocation would occur in deleting and creating an element. Since that would be the only way to modify a list entry, perhaps it should be there. >I wonder why you choose testing the equality with a special value to mark >the end of iteration instead of having a "done" function. (If you Force of habit. I'm used to implementing these things as naked pointers. I think the proper idiom probably should be "Done_Iterating" as a boolean function, as you say (or perhaps "More_Elements", so the while condition is positive). Does anyone disagree? Does anyone think they should *both* be there? --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.