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-Thread: 103376,f2690a5e963b61b6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: GCC 4.0 Ada.Containers Cursor danger. References: <1120583470.429264.325450@g43g2000cwa.googlegroups.com> <1120639461.224146.235430@g44g2000cwa.googlegroups.com> <1120642489.101644.74190@o13g2000cwo.googlegroups.com> <1120643138.031761.212450@g43g2000cwa.googlegroups.com> <42cbb52c$0$10807$9b4e6d93@newsread4.arcor-online.net> <1120666922.733581.179180@g47g2000cwa.googlegroups.com> <42cc1f0f$0$10808$9b4e6d93@newsread4.arcor-online.net> <1120739383.801736.224270@o13g2000cwo.googlegroups.com> <42cd343b$0$22784$9b4e6d93@newsread2.arcor-online.net> <1120759007.967336.187840@g47g2000cwa.googlegroups.com> <42cda8db$0$22780$9b4e6d93@newsread2.arcor-online.net> <1121450624.207988.262710@g14g2000cwa.googlegroups.com> <1121572515.355276.292180@o13g2000cwo.googlegroups.com> From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 17 Jul 2005 04:29:10 GMT NNTP-Posting-Host: 24.149.57.125 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.atl.earthlink.net 1121574550 24.149.57.125 (Sat, 16 Jul 2005 21:29:10 PDT) NNTP-Posting-Date: Sat, 16 Jul 2005 21:29:10 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:3644 Date: 2005-07-17T04:29:10+00:00 List-Id: "Dmitriy Anisimkov" writes: > So, we have "Unchecked_". Pointer arithmetic in Ada. If the name of the > Cusrosrs would be Unchecked_Cursor, and there is in Ada.Containers > would be complete set of access routines without cursors, it would be > Ok. This is a false analogy, since the name of the operations are To_Pointer and To_Address. Nary an "unchecked" in site... > Yes, I'm late, but I guess not only me do not like such unsafety. (or > checking the cursors gotten from machine model unsafety.) > Maybe we should review Ada.Containers interface. The implementation is > good, but we should have a safer interface i think. But we can detect dangling cursors. What other safety do you want? > I think high level interfaces should not be based on machine model in > Ada. That's fine, but you should have submitted this mystery design of yours 2 years ago. > It is good for C, but not good for Ada. If you don't like cursors, then you don't have to use them. > Ada have an access to > machine model, but it is all in Unchecked and system representation > parts. Machine model is isolated from safety programming in Ada. If you compile with assertions enabled, then you can detect dangling cursors. What's not safe about that? > If there is a cursor, it should be checked for sure, not only with > turned on assert checking. But I prefer to work without cursors, so I > need the complete set of access routines without such checking cursors. Without a cursor you'd have to search for the key. A cursor allows you to optimize-away the lookup. > Every time you say "if you need, do it." i could, but i could guess > from this thread that not only me have a vision of containers library > interface without cursors. Whatever your vision is, you should have ennunciated it 2 years ago...