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!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 20 Jul 2005 22:20:39 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1120474891.635131.216700@g44g2000cwa.googlegroups.com> <42cb8d21$0$22761$9b4e6d93@newsread2.arcor-online.net> <42cd064c$0$10817$9b4e6d93@newsread4.arcor-online.net> <42cda8c4$0$22780$9b4e6d93@newsread2.arcor-online.net> <1u3hh2597i4ne$.1ryetugksbmus.dlg@40tude.net> <1120834341.499757.133770@g43g2000cwa.googlegroups.com> <1121093867.964444.232420@g14g2000cwa.googlegroups.com> <42d2bc2d$0$20148$9b4e6d93@newsread2.arcor-online.net> <1121134291.379399.79460@z14g2000cwz.googlegroups.com> <42d46b51$0$18005$9b4e6d93@newsread4.arcor-online.net> <42d6ef47$0$7644$9b4e6d93@newsread2.arcor-online.net> Subject: Re: GCC 4.0 Ada.Containers Cursor danger. Date: Wed, 20 Jul 2005 22:23:45 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-zy43rOWZWpKdGtX5u4A0POf7ERbb82U0YU5hgooiZQPZNEbk9L3KAeyUliEWdfhPtYFWs4bqJHnOn67!XPwsZ7Fk2iPDtWkFunF3N6/d1UyloR/GR7Y55pzlad/hAYEIaewKClKhK5PlanYbp6Ca0y6A6uBe X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.31 Xref: g2news1.google.com comp.lang.ada:3715 Date: 2005-07-20T22:23:45-05:00 List-Id: "Simon Wright" wrote in message news:m2k6jmaw9n.fsf@grendel.local... > Matthew Heaney writes: > > > Access types wouldn't work, since you would have to declare the > > container element as "aliased" in order to return an access value, > > but that would constrain the object (fix the value of the > > discriminant). > > Is this still true in 0Y? No. Virtually all of those rules were repealed; they made no sense and didn't really fix the real problem. The better solution was to make some access subtypes illegal instead. (If you don't even know what an access subtype is, you're not alone. I don't think I've ever used one in 20+ years of Ada programming.) So we could have used access types rather than defining cursors, but we didn't do it because access types can never be safe in this case, while cursors can be checked. Similarly, we use a call-back procedure in Update_Element rather than an access type, because we can check for abuse in the routine. Randy.