comp.lang.ada
 help / color / mirror / Atom feed
* Generics & Elaboration Order
@ 2000-05-08  0:00 Andrew Logue
  2000-05-09  0:00 ` Robert Dewar
  2000-05-09  0:00 ` Robert A Duff
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Logue @ 2000-05-08  0:00 UTC (permalink / raw)


Hello,

I need help to instantiate a generic package with an actual parameter whose 
value must be determined at run-time.

Please take a peek at the following pseudo-code:


package body main is

  Actual_Parameter : Boolean := False;
  package New_Pack is new Generic_Package( Parameter => Actual_Parameter );

  begin  -- package elaboration code

    if some_package.embedded_computer_type = some_package.type_A then

      Actual_Parameter := True;
 
    else

      Actual_Parameter := False;

    end if;


end main;

Given the above code, and the embedded computer type is type_A, will 
New_Pack be instantiated with an Actual_Parameter value of True or False?

i.e. does the code in package body execute before the generic is 
instantiated?


Thank you for your feedback,

Andrew Logue,
Computing Devices Canada.




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

end of thread, other threads:[~2000-05-21  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-08  0:00 Generics & Elaboration Order Andrew Logue
2000-05-09  0:00 ` Robert Dewar
2000-05-18  0:00   ` ANTHONY GAIR
2000-05-18  0:00     ` Robert A Duff
2000-05-19  0:00       ` ANTHONY GAIR
2000-05-21  0:00         ` Robert Dewar
2000-05-09  0:00 ` Robert A Duff

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