From: Simon Wright <simon@pushface.org>
Subject: Re: How do package body initializers get run in GNU Ada?
Date: 03 Nov 2002 20:14:59 +0000
Date: 2002-11-03T20:14:59+00:00 [thread overview]
Message-ID: <x7v3cqifm0s.fsf@smaug.pushface.org> (raw)
In-Reply-To: c0e14fb0.0211030337.7f1af8ba@posting.google.com
russian_power@hotmail.com (Romanov) writes:
> I thought it was done when the package was being elaborated? Package
> elaboration takes place when the package is instantiated. statements
> like 'with text_io;' executes the body initializers.
I am pretty sure that "with text_io;" will only execute the spec
elaboration -- which is why you have to be careful when your
initialization calls functions in other packages, cos the _body_ of
the other package needs to have been elaborated.
> but i use the dynamic elaboration feature in gnat. so much easier...
> you only get a problem when you try to use another joker who uses
> static elaboration instead...
This seems odd to me, it's loads easier to let GNAT do its own thing
and not have to worry. I admit that a program of ours that built fine
under 3.09 caused us a lot of grief when we tried to migrate to 3.12
-- so much so that we stayed with 3.09 until we had to port to Solaris
x86, with no possible way of building a 3.09 compiler. I can also see
that if you want portability to other compilers you might have to be
explicit ..
prev parent reply other threads:[~2002-11-03 20:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-02 0:39 How do package body initializers get run in GNU Ada? Van Snyder
2002-11-02 1:23 ` Jeffrey Carter
2002-11-02 1:28 ` sk
2002-11-04 15:20 ` Stephen Leake
2002-11-05 1:03 ` sk
2002-11-02 16:00 ` Robert A Duff
2002-11-03 2:45 ` David Marceau
2002-11-03 11:37 ` Romanov
2002-11-03 20:14 ` Simon Wright [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox