comp.lang.ada
 help / color / mirror / Atom feed
From: Craig Carey <research@ada95.ijs.com>
Subject: Re: have to use unrestricted access but just what about access
Date: Sun, 21 Jul 2002 08:45:06 GMT
Date: 2002-07-21T08:45:06+00:00	[thread overview]
Message-ID: <ptskjucuvfua22p2c35t9gvirkbi37disf@4ax.com> (raw)
In-Reply-To: wcc65zapa04.fsf@shell01.TheWorld.com

On Sat, 20 Jul 2002 17:47:07 GMT, Robert A Duff
<bobduff@shell01.TheWorld.com> wrote:
...
>No.  If you look up the definition of "aliased", I don't think you'll
>find any mention of "by reference".
...
>But the other way around is not true: passing a parameter by reference
>does not imply that it's aliased.
>


Here is text from the AARM saying that internal formal parameter is an
aliased view of the external actual object if the type is tagged.

---------------
>AARM 3.10 Access Types
...
>9  {aliased} ... In addition, the dereference of an access-to-
>object value denotes an aliased view, as does a view conversion
>(see 4.6) of an aliased view. Finally, the current instance of a
>limited type, and a formal parameter or generic formal object of
>a tagged type are defined to be aliased. [Aliased views are the
>ones that can be designated by an access value.] ...
...
>9.g  A formal parameter of a tagged type is defined to be
>aliased so that a (tagged) parameter X may be passed to an access
>parameter P by using P => X'Access. Access parameters are most
>important for tagged types because of dispatching-on-access-
>parameters (see 3.9.2). By restricting this to formal parameters,
>we minimize problems associated with allowing components that are
>not declared aliased to be pointed-to from within the same
>record.
http://www.adaic.org/standards/95aarm/html/AA-3-10.html
---------------

I am not clear on this here: if there is a java-like background garbage
 collector, then applying 'Access on a not-aliased but by-reference
 not-tagged and not limited but Volatile internal formal record object
 might sometimes fail to give the address of external actual object that
 is safe to use...?. (Section C.6 of the AARM does not contain the word
 "aliased").

Anyway, when the type is "tagged", 3.10(9) that the parameter passing
 is by the aliased mode (the actual external isn't cached or shifting,
 etc.).


>>... A type can be made to be by-reference using "pragma Voltile".
>
>But you wouldn't want to do that, because it might damage efficiency.
>

My "pragma Volatile"s in the example can be deleted: the record was
tagged.


Thanks.



>> Craig Carey,
>> 
>>  http://www.ijs.co.nz/ada_95 (some Ada 95 mailing lists)




  reply	other threads:[~2002-07-21  8:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-19 23:32 have to use unrestricted access but just what about access chris.danx
2002-06-20  8:41 ` chris.danx
2002-06-20 12:10 ` SteveD
2002-06-20 14:22 ` Robert A Duff
2002-06-21 11:45   ` Robert Dewar
2002-06-22  0:49     ` Robert A Duff
2002-06-22  1:05       ` Ted Dennison
2002-06-22 12:09         ` Robert Dewar
2002-07-20  4:59     ` Craig Carey
2002-07-20 17:47       ` Robert A Duff
2002-07-21  8:45         ` Craig Carey [this message]
2002-06-20 16:05 ` Robert Dewar
2002-06-20 17:11   ` chris.danx
replies disabled

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