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,LOTS_OF_MONEY, 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,93ab7fc5388e249 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-06 08:19:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!hub1.nntpserver.com!nntp-relay.ihug.net!ihug.co.nz!out.nntp.be!propagator-SanJose!in.nntp.be!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <3C0E1FA1.45A38A75@brighton.ac.uk> <%7sP7.49836$xS6.82296@www.newsranger.com> Subject: Re: Iterator approach (was: List container strawman 1.3) 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: Thu, 06 Dec 2001 11:19:18 EST Organization: http://www.newsranger.com Date: Thu, 06 Dec 2001 16:19:18 GMT Xref: archiver1.google.com comp.lang.ada:17512 Date: 2001-12-06T16:19:18+00:00 List-Id: In article , Ted Dennison says... > >In article , Mark Lundquist says... >>In the access discriminator way, any state of affairs that could give rise >>to a dangling iterator results in a compile-time error, and the safety comes >>at no added run-time expense. The chained iterator approach results in a > >I don't think that's true at all. Suppose I have the following (using your >example): > >. type List_Ptr is access My_Lists.List; >. type Iterator_Ptr is access My_Lists.Iterator; >. function Free is new Unchecked_Deallocation (My_Lists.List, List_Ptr); >. function Free is new Unchecked_Deallocation (My_Lists.Iterator, >Iterator_Ptr); Damn. Got cut off again. The idea here is that I dynamicly allocate both the list and an associated iterator, then use Free to deallocate only one of them. I don't believe the compiler would give that code any error, and I end up having a pointer to nowhere that the List facility has no way to detect. Not "safe". --- 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.