comp.lang.ada
 help / color / mirror / Atom feed
From: "Pat Rogers" <progers@NOclasswideSPAM.com>
Subject: Re: "out" or "access"
Date: 1998/10/22
Date: 1998-10-22T00:00:00+00:00	[thread overview]
Message-ID: <70nhch$nhr$1@supernews.com> (raw)
In-Reply-To: 70l1nq$mrb$1@cnn.Princeton.EDU

Martin C. Carlisle wrote in message
<70l1nq$mrb$1@cnn.Princeton.EDU>...
>Be careful using access as below, as this creates two different
>dispatched objects in the call (which is illegal).  See LRM 6.1(24)
>and 3.9.2


You seem to be saying that there is no legal call with this
approach, but neither RM reference supports that conclusion.

The actual parameters to a call make a given call illegal or not,
and that depends upon what is passed, per call.  For example, if the
actuals are statically-tagged -- the typical case -- there is no
problem.  If both actuals are dynamically-tagged they have to have
the same tag, which is checked at run-time per RM 3.9.2(16).  A call
cannot have both statically-tagged and dynamically-tagged
controlling operands, per RM 3.9.(8), but that is just one case.

>>  type T1 is tagged ...
>>
>>  type T1_Pointer is access T1;
>>
>>  procedure Foo( This : in T1;   That : in T1_Pointer );
>>
>>Then, in a derivation:
>>
>>  type T2 is new T1 with ...
>>
>>This gives us:
>>
>>
>>  procedure Foo( This : in T2;  That : in T1_Pointer );
>>
>>Note that the type of the formal 'That' is still T1_Pointer,
>>probably not what we wanted.
>>
>>On the other hand, had we defined things as:
>>
>>  type T1 is tagged ...
>>
>>  -- don't need this now...  type T1_Pointer is access T1;
>>
>>  procedure Foo( This : in T1;   That : access T1 );
>>
>>The derivation would provide
>>
>>  procedure Foo( This : in T2;   That : access T2 );
>>
>>which is probably the desired result in this case.



---
Pat Rogers                          Training & Development in:
http://www.classwide.com    Deadline Schedulability Analysis
progers@acm.org                 Software Fault Tolerance
(281)648-3165                       Real-Time/OO Languages






  reply	other threads:[~1998-10-22  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-21  0:00 "out" or "access" =:-) Vincent
1998-10-21  0:00 ` Jeff Carter
1998-10-21  0:00   ` Pat Rogers
1998-10-21  0:00     ` Martin C. Carlisle
1998-10-22  0:00       ` Pat Rogers [this message]
1998-10-22  0:00     ` Robert A Duff
1998-10-21  0:00 ` dennison
1998-10-21  0:00 ` Tucker Taft
1998-10-22  0:00   ` Pascal Obry
1998-10-29  0:00     ` Robert A Duff
1998-10-29  0:00       ` Matthew Heaney
1998-10-29  0:00         ` Robert A Duff
1998-10-30  0:00           ` dennison
1998-10-30  0:00             ` Matthew Heaney
1998-10-30  0:00               ` Robert A Duff
1998-10-31  0:00                 ` dewar
1998-10-31  0:00                   ` Matthew Heaney
1998-10-31  0:00                 ` Matthew Heaney
1998-11-01  0:00                   ` Robert A Duff
1998-11-01  0:00                     ` Matthew Heaney
1998-11-01  0:00                       ` Robert A Duff
1998-11-02  0:00                         ` Matthew Heaney
1998-11-03  0:00                           ` Simon Wright
1998-11-16  0:00                             ` Matthew Heaney
replies disabled

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