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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f32236e7e55b02e0 X-Google-Attributes: gid103376,public From: Ole-Hjalmar Kristensen Subject: Re: Ada Queue Date: 2000/04/07 Message-ID: #1/1 X-Deja-AN: 607906712 Sender: ohk@gong2.clustra.com References: <38eca724@news.hamilton.edu> <8ciesn$4mt$1@nnrp1.deja.com> <38ecc752@news.hamilton.edu> <8cisft$jtg$1@nnrp1.deja.com> <38ed0123@news.hamilton.edu> X-Complaints-To: abuse@telia.no X-Trace: news.telia.no 955094277 195.204.160.194 (Fri, 07 Apr 2000 09:57:57 CEST) Organization: Telia Internet Public Access NNTP-Posting-Date: Fri, 07 Apr 2000 09:57:57 CEST Newsgroups: comp.lang.ada Date: 2000-04-07T00:00:00+00:00 List-Id: "Joseph T." writes: > Yes...I am looking for that techincal discussion...you're so slick. =) > > Let me ask you this...how come then, did the author of this page ( a CS professor > ) choose the same method shown here: > > http://www.cm.cf.ac.uk/Dave/C/node11.html > > I think that the Ada replicates the method in C used by this professor. > Does his code suffer from the same things you mentioned? > It would perhaps have been clearer for the reader to use a temporary variable to iterate, but there are no other drawbacks associated with his method, which is indeed a very common way of doing it in C. But the algorithms can be made simpler (but perhaps not clearer) by using a pointer to a pointer instead of a simple pointer. For example, the AddItem code can be made much simpler by defining it as listelement * AddItem (listelement ** listpointer, int data); How to simplify the body of the function is left as an exercise to the reader :-) > Thanks so much. > -- E pluribus Unix