comp.lang.ada
 help / color / mirror / Atom feed
From: russian_power@hotmail.com (Romanov)
Subject: Re: How do package body initializers get run in GNU Ada?
Date: 3 Nov 2002 03:37:14 -0800
Date: 2002-11-03T11:37:14+00:00	[thread overview]
Message-ID: <c0e14fb0.0211030337.7f1af8ba@posting.google.com> (raw)
In-Reply-To: 3DC31EBB.2050809@math.jpl.nasa.gov

Van Snyder <vsnyder@math.jpl.nasa.gov> wrote in message news:<3DC31EBB.2050809@math.jpl.nasa.gov>...
> In GNU Ada, what mechanism is used to cause execution of package
> body initializers, i.e., the code between begin and end in a
> package body?
> 
> Is it done using some kind of back-patching/overlaying done
> by an otherwise garden-variety ld, by special features added
> to ld to support Ada, by first-time flags at the entries
> to procedures, or by something else?

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.

Ada is much more precise about initialization that C/C++ is. That's
why we have 'pragma elaborate(xxx);' statements

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...



  parent reply	other threads:[~2002-11-03 11:37 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 [this message]
2002-11-03 20:14   ` Simon Wright
replies disabled

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