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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,68536605ede13a20 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.190.71 with SMTP id go7mr3302926pbc.8.1324428676346; Tue, 20 Dec 2011 16:51:16 -0800 (PST) Path: lh20ni46053pbb.0!nntp.google.com!news2.google.com!postnews.google.com!n6g2000vbg.googlegroups.com!not-for-mail From: Simon Belmont Newsgroups: comp.lang.ada Subject: Re: GNAT - return by anonymous access Date: Tue, 20 Dec 2011 16:44:35 -0800 (PST) Organization: http://groups.google.com Message-ID: <95f3b0fc-af24-4ace-afc9-227e8893ea99@n6g2000vbg.googlegroups.com> References: <784c67eb-a542-41b0-b23d-fca1234e56b2@n10g2000vbg.googlegroups.com> NNTP-Posting-Host: 24.218.138.255 Mime-Version: 1.0 X-Trace: posting.google.com 1324428674 11490 127.0.0.1 (21 Dec 2011 00:51:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 21 Dec 2011 00:51:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n6g2000vbg.googlegroups.com; posting-host=24.218.138.255; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; InfoPath.2),gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-12-20T16:44:35-08:00 List-Id: On Dec 20, 6:18=A0pm, "Randy Brukardt" wrote: > > Personally, I'd just avoid anonymous access types, but I'm not going to g= o > so far as to recommend that (there are things that are hard to do any oth= er > way). > It is my understanding that Ada05 has done away with 'return-by- reference' in favor of 'return-by-anonymous-access', which would lead me to believe that you would *have* to use them if you want to return an allocated limited type. Personally I am suspect of this method, as it exposes the access value to the nefarious shenanigans other code could potentially try (hence the original code that was testing ways of protecting the value inside an object). Are there other ways of doing this that aren't so...dubious?