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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Bob Duff Newsgroups: comp.lang.ada Subject: Re: Strange error Date: Fri, 23 Jan 2015 19:47:16 -0500 Organization: A noiseless patient Spider Message-ID: <87mw599f8r.fsf@adacore.com> References: <713608f7-d46e-4b73-a34e-552d1b978d2c@googlegroups.com> <01fc779f-e274-4515-a88f-144d515d323f@googlegroups.com> <3fa7d4c4-f9fe-4d00-9034-a348802087a9@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="b517e9a5d71ce0b52e2e81512ffb00e4"; logging-data="315"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nKDIFyKI2zuLpGicySEsr" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:JssU20fYcPhrLnUy34DMcPbC+ow= sha1:m3CGzkbALsXF3o/8xwQZGvRAjWw= Xref: number.nntp.giganews.com comp.lang.ada:192030 Date: 2015-01-23T19:47:16-05:00 List-Id: Laurent writes: > Quite obvious could have found that myself by thinking/searching a bit more. > > How do you professionals prevent such stupid errors? I am just a noob and > playing a bit around so it has no impact on anything. One way is to use Ada.Containers.Doubly_Linked_Lists. But that won't work for you, because you're not trying to use doubly-linked lists, you're trying to learn how to implement them. Which is something programmers should know how to do. So draw a doubly-linked list on paper, with circles and arrows. Go through each procedure and "execute" it by hand, erasing the arrows and drawing new ones. Take care to execute what you wrote, not what you meant to write. Bugs like the one mentioned will usually become obvious. - Bob