comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Generics & Elaboration Order
Date: 2000/05/09
Date: 2000-05-09T00:00:00+00:00	[thread overview]
Message-ID: <wcczoq07wum.fsf@world.std.com> (raw)
In-Reply-To: 8F2E930FAandrewloguecdcgycom@142.77.1.194

nospam.andrew.logue@cdcgy.com (Andrew Logue) writes:

> 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 presume Parameter is mode 'in'.  In that case, False is passed.

If Parameter is mode 'in out', then it's like a renaming,
but I don't think that's what you're talking about.

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

No.

- Bob




  reply	other threads:[~2000-05-09  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-08  0:00 Generics & Elaboration Order Andrew Logue
2000-05-09  0:00 ` Robert A Duff [this message]
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
replies disabled

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