comp.lang.ada
 help / color / mirror / Atom feed
From: GianLuigi Piacentini <ggpiace@tin.it>
Subject: Curiosity in generic package instantiation
Date: Wed, 20 Aug 2014 00:26:01 +0200
Date: 2014-08-20T00:26:01+02:00	[thread overview]
Message-ID: <lt0itn$1g5$1@dont-email.me> (raw)

Hi all,

pardon if using not the exact terminology (too old to learn ADA intricacies, 
whish had done it back in the '80-'90 when I was active programmer, but then 
in Italy buzzword was c/c++ m$oft version, and VB), I noticed the following 
excerpt in a previous thread:

...
procedure Test_List is
    type Example_Type is record
      A :Integer := 0;
      B: Integer := 0;
    end record;

...

  declare
    Data : Example_Type;
    package Example_Pkg is new
Ada.Containers.Doubly_Linked_Lists(Example_Type);
    List : Example_Pkg.List;

if I understand well, this means that the Ada.Containers.Doubly_Linked_Lists 
package is instantiated using Example_Type, and the instantiated list name 
is Example_Pkg.List.

Is this done by text substitution at source/intermediate code level 
(something like the C preprocessor), albeit in an user-transparent (=better) 
way, or is it obtained by some property of the list elements, able to store 
whatever is thrown at them, even elements of different type in the same 
list?

My 1st guess looking at the code is sort of compiler-integrated 
preprocessing.

Just curious.

Thanks in advance.

Gigi


             reply	other threads:[~2014-08-19 22:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 22:26 GianLuigi Piacentini [this message]
2014-08-19 23:16 ` Curiosity in generic package instantiation Adam Beneschan
2014-08-20  8:56   ` Mark Lorenzen
2014-08-21 22:32     ` Randy Brukardt
2014-08-21 22:39   ` Randy Brukardt
2014-08-20  7:18 ` Björn Lundin
replies disabled

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