comp.lang.ada
 help / color / mirror / Atom feed
* grassroots thoughts on access types
@ 2018-02-09  0:46 Mehdi Saada
  2018-02-09  1:23 ` Randy Brukardt
                   ` (3 more replies)
  0 siblings, 4 replies; 36+ messages in thread
From: Mehdi Saada @ 2018-02-09  0:46 UTC (permalink / raw)


In my corrected exercices, I can read:

package P_Token.F is
   type T_Ptr_Token is access all T_Token'Class;
end P_Token.F;

package body  P_Token.Operateur.F is

   type T_Ptr_Token_Operateur is access all T_Token_Operateur;

   function Set_Ptr (Elem : in T_Operateur) return T_Ptr_Token is
      Ptr_Token : T_Ptr_Token_Operateur;
   begin
      Ptr_Token := new T_Token_Operateur;
      Initialisation(Ptr_Token.all,Elem);
      return Ptr_Token.all'access; -- @@@ HERE
   end Set_Ptr;

end P_Token.Operateur.F;

and

I understand the line marked (took me several minutes though ;-) ) but not the logic. Instead of
function Set_Ptr (Elem : in T_Operateur) return T_Ptr_Token is
      Ptr_Token : T_Ptr_Token_Operateur;
can we write:
 function Set_Ptr (Elem : in T_Operateur) return T_Ptr_Token is
      Ptr_Token : T_Ptr_Token;
? What's the difference regards to implementation, memory usage or anything ?
T_TOKEN is a null tagged record type, T_TOKEN_OPERATEUR has one more enumerative component.


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

end of thread, other threads:[~2018-02-11 21:51 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09  0:46 grassroots thoughts on access types Mehdi Saada
2018-02-09  1:23 ` Randy Brukardt
2018-02-09  9:13   ` Simon Wright
2018-02-09 11:06     ` Dmitry A. Kazakov
2018-02-09 12:09 ` Mehdi Saada
2018-02-09 12:11   ` Mehdi Saada
2018-02-09 14:23     ` Simon Wright
2018-02-09 16:11       ` Mehdi Saada
2018-02-09 17:01 ` Jeffrey R. Carter
2018-02-09 17:19   ` Dmitry A. Kazakov
2018-02-09 19:12     ` Jeffrey R. Carter
2018-02-09 20:17       ` Robert A Duff
2018-02-09 21:44         ` Jeffrey R. Carter
2018-02-09 22:06           ` Dmitry A. Kazakov
2018-02-10  0:43             ` Mehdi Saada
2018-02-10  1:51               ` Mehdi Saada
2018-02-10 10:07                 ` Jeffrey R. Carter
2018-02-10 11:57                 ` Mehdi Saada
2018-02-10 14:02                   ` Simon Wright
2018-02-10 15:32                   ` Jeffrey R. Carter
2018-02-10 16:46                     ` Mehdi Saada
2018-02-10  8:28               ` Dmitry A. Kazakov
2018-02-10 11:55                 ` Mehdi Saada
2018-02-10 14:35                   ` Dmitry A. Kazakov
2018-02-10 16:51                     ` Simon Wright
2018-02-10 17:19                       ` Dmitry A. Kazakov
2018-02-10 10:03             ` Jeffrey R. Carter
2018-02-10 10:36               ` Dmitry A. Kazakov
2018-02-10 11:12                 ` Jeffrey R. Carter
2018-02-10 14:44                   ` Dmitry A. Kazakov
2018-02-10 21:16           ` Robert A Duff
2018-02-11 10:47             ` Jeffrey R. Carter
2018-02-11 21:51               ` Robert A Duff
2018-02-09 20:58       ` Shark8
2018-02-09 20:32 ` G. B.
2018-02-09 20:53   ` Mehdi Saada

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