comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Belmont <sbelmont700@gmail.com>
Subject: Re: GNAT - return by anonymous access
Date: Thu, 22 Dec 2011 14:11:40 -0800 (PST)
Date: 2011-12-22T14:11:40-08:00	[thread overview]
Message-ID: <8a7d4dc1-69e5-479f-84a3-5c9c7bdd9aae@j10g2000vbe.googlegroups.com> (raw)
In-Reply-To: 6e5ee357-7409-4974-917c-d7236c782d31@h11g2000yqd.googlegroups.com

On Dec 22, 2:11 am, Adam Beneschan <a...@irvine.com> wrote:

> I think this could be solved by declaring a private type (limited
> private, if you prefer) to represent an "access" or "handle" or
> "reference" to test_type.
>

That's essentially the path I was taking, but it's doesn't scale well
(at all, really).  You essentially have to remake every primitive
operation of the original type for the new faux-access to forward the
calls so that anything useful could be done.  I guess on a case-by-
case basis that would work, but not in general.  And if you provide a
function to return the access type, then you are right back into the
same situation of having it exposed to potential grief.  It's too bad
access types can't be limited...

>
> You might want to check out
>
> http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ais/ai-10318.txt?rev=1.16
>

Thanks for that link, it was exactly the type of info i was interested
in.

-sb



  reply	other threads:[~2011-12-22 22:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 19:17 GNAT - return by anonymous access Simon Belmont
2011-12-17 19:51 ` Simon Wright
2011-12-18  9:08 ` Georg Bauhaus
2011-12-19 23:46 ` Randy Brukardt
2011-12-20  0:14   ` Shark8
2011-12-20 23:18     ` Randy Brukardt
2011-12-21  0:44       ` Simon Belmont
2011-12-21  7:29         ` AdaMagica
2011-12-21 11:05           ` Georg Bauhaus
2011-12-21 11:43             ` AdaMagica
2011-12-21 12:05               ` Georg Bauhaus
2011-12-22  0:33                 ` Randy Brukardt
2011-12-22  0:33           ` Simon Belmont
2011-12-22  7:11             ` Adam Beneschan
2011-12-22 22:11               ` Simon Belmont [this message]
2011-12-23  0:56                 ` Randy Brukardt
2011-12-23 13:20                   ` Simon Belmont
2011-12-27 23:51                     ` Randy Brukardt
2011-12-20 23:53 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox