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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9272170244740794 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-17 12:47:40 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3BF6CCD6.F7195928@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: List container straw man (NJR V4) References: <9t1lp4$16unne$3@ID-25716.news.dfncis.de> <9t69pc$jh6l$2@ID-25716.news.dfncis.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 17 Nov 2001 20:47:50 GMT NNTP-Posting-Host: 209.86.207.101 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1006030070 209.86.207.101 (Sat, 17 Nov 2001 12:47:50 PST) NNTP-Posting-Date: Sat, 17 Nov 2001 12:47:50 PST Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Sat, 17 Nov 2001 12:43:31 PST (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:16653 Date: 2001-11-17T20:47:50+00:00 List-Id: Nick Roberts wrote: > > Okay, I've popped my own proposal on a web site: > > http://www.adaos.ukf.net > > with pointers to the rivals^H^H^H^H^H^Halternatives I'm aware of. Do please > pay a visit. This is difficult to understand. This is the only place I've ever seen the concept of "cursorage"; it is certainly not a standard list concept. Combining the indexed operations and the cursor-based operations is called control coupling and makes the operations difficult to understand. The use of undefined types is confusing. I suppose they're declared in the parent package, but since we can't see the parent package it's still confusing. The use of an abstract type and operations followed by a non-abstract extension and non-abstract operations doubles the size of the specification without adding any value that I can see. Every concrete list is going to have to declare and implement every operation, so declaring them abstract an additional time seems like a waste of time. Is_Empty and Length are basic list operations that are missing. A component should not raise predefined exceptions such as Constraint_Error. Use meaningful exceptions such as Cursor_Is_Null. A concrete implementation should document the time complexity of every operation, so the client can make appropriate choices of operations. This argues against putting them in the private part. For an unbounded list, the time complexity of the string- and dequeue-like operations will be O(N), since they will have to do deep copies. The time complexity of the indexed operations will be O(N), since they have to count down the list. The cursor-based operations will tend to be O(1); since they have the lowest time complexity they should be the preferred operations and should therefore be presented first. Each operation should document its pre- and post-conditions, where applicable. Each operation should document what exceptions it may raise and under what circumstances; since exceptions are generally indications that the client has violated a precondition, the documentation for preconditions is usually a good place to document exceptions. With some more work this could be an acceptable standard specification. -- Jeff Carter "Hello! Smelly English K...niggets." Monty Python & the Holy Grail