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,adae40bcc4d01baf X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon02.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada 95 constructors on limited types Date: Sat, 05 Jan 2008 09:59:07 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <08dc2b30-6c8c-4cff-9f2e-c0d4c377972d@i3g2000hsf.googlegroups.com> <874pds36mu.fsf@ludovic-brenta.org> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1199545148 19394 192.74.137.71 (5 Jan 2008 14:59:08 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 5 Jan 2008 14:59:08 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:2Pu/GdbisYoKhrSXtyHyGq7hQvs= Xref: g2news1.google.com comp.lang.ada:19215 Date: 2008-01-05T09:59:07-05:00 List-Id: Ludovic Brenta writes: > Brian May writes: >>>>>>> "Jeffrey" == Jeffrey R Carter writes: >> >> Jeffrey> shaunpatterson@gmail.com wrote: >> >> >> >> package Parent is >> >> >> >> type Class is abstract tagged limited null record; >> >> type Class_Access is access all Class'Class; >> >> >> >> end Parent; >> >> Jeffrey> There's your problem. Don't use public access types. >> >> Why not? > > Because they automatically make the package impure for no good reason, > thereby preventing use of the package in pure or preelabotated > packages. Moral: Declare your access types only if and where you need > them. Jeff was complaining only about PUBLIC access types. I don't entirely agree with him -- at least, I'd put it less strongly. But anyway, the purity issue applies to access types whether they are public or not. I agree that it's good to make things Pure when possible. Note that the rule was relaxed in Ada 2005 -- you can say: type T is access Blah; for T'Storage_Size use 0; and still have pragma Pure. You can also have access-to-constant and access-to-subprogram types. - Bob