comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How to get around "access type must not be outside generic unit"
Date: Mon, 18 Dec 2006 19:48:49 -0600
Date: 2006-12-18T19:48:49-06:00	[thread overview]
Message-ID: <2bmdnS4ilvNa2RrYnZ2dnUVZ_r2onZ2d@megapath.net> (raw)
In-Reply-To: sa47iwo94o8.fsf@margay.local

"Brian May" <bam@snoopy.apana.org.au> wrote in message
news:sa47iwo94o8.fsf@margay.local...
> >>>>> "Jean-Pierre" == Jean-Pierre Rosen <rosen@adalog.fr> writes:
...
>     Jean-Pierre> Taking the 'access in the specification is illegal,
>     Jean-Pierre> and (as explained above), the instantiation would be
>     Jean-Pierre> illegal.
>
> I get lost here. Why is taking the 'access value in the specification
> illegal if the generic has been instantiated inside a procedure?

The accessibility check fails. That's the check that prevents dangling
pointers. JP is assuming that the Register routine and it's access type is
declared at the library level when he "says inside of a procedure".

Note that the rule is "assume-the-worst", and it is always possible to
instantiate at a more nested level than the Register routine is defined. So
the 'access is always illegal in a body. OTOH, in specifications the rule is
"assume-the-best and recheck on instantiation". So if you put the 'access in
the private part, it is OK (until you write a nested instance, but then that
instance is illegal).

                     Randy.





  reply	other threads:[~2006-12-19  1:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-17 10:07 How to get around "access type must not be outside generic unit" Michael Erdmann
2006-12-17 12:45 ` Pascal Obry
2006-12-17 14:28   ` Michael Erdmann
2006-12-17 15:53     ` Pascal Obry
2006-12-17 20:49     ` Robert A Duff
2006-12-18  3:35   ` Brian May
2006-12-18  7:49     ` Jean-Pierre Rosen
2006-12-18 23:15       ` Brian May
2006-12-19  1:48         ` Randy Brukardt [this message]
2006-12-19  7:41         ` Jean-Pierre Rosen
2006-12-18 20:32     ` Michael Erdmann
2006-12-18 20:57       ` Randy Brukardt
2007-01-23 18:18 ` [Revisited] How to get around "access type must not be outside generic unit" (was: How to get around "access type must not be outside generic unit") Dmitry A. Kazakov
2007-01-24  0:57   ` Randy Brukardt
2007-01-24 11:42     ` [Revisited] How to get around "access type must not be outside generic unit" Dmitry A. Kazakov
2007-01-24 11:58       ` Ludovic Brenta
2007-01-24 13:46         ` Dmitry A. Kazakov
2007-01-24 20:50       ` Randy Brukardt
2007-01-25 11:07         ` Dmitry A. Kazakov
replies disabled

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