comp.lang.ada
 help / color / mirror / Atom feed
* Equivalence between named access and anonymous access.
@ 2023-09-06 14:37 Blady
  2023-09-06 15:54 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Blady @ 2023-09-06 14:37 UTC (permalink / raw)


Hello,

I'm wondering about named access and anonymous access.
In the following Ada code, are the writing of parameter P1 type of 
procedures PA and PB equivalent ?

package C1 is
   type Inst is tagged null record;
   type Class is access all Inst'Class;
end C1;

with C1;
package C2 is
   type Inst is tagged null record;
   type Class is access all Inst'Class;

   procedure PA (Self : Inst; P1 : C1.Class); -- named access
   procedure PB (Self : Inst; P1 : access C1.Inst'Class); -- anonymous 
access
end C2;

Same with:
   function FA (Self : Inst) return C1.Class; -- named access
   function FB (Self : Inst) return access C1.Inst'Class; -- anonymous 
access

Are FA and FB writing equivalent?
If not why?

Thanks, Pascal.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-09-07 20:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06 14:37 Equivalence between named access and anonymous access Blady
2023-09-06 15:54 ` Dmitry A. Kazakov
2023-09-07 16:06   ` Blady
2023-09-07 16:18     ` Jeffrey R.Carter
2023-09-07 19:10       ` Blady
2023-09-07 20:23     ` Dmitry A. Kazakov
2023-09-06 20:55 ` Gautier write-only address
2023-09-07  0:20 ` Jeffrey R.Carter

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