comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Elaboration worries
Date: 21 Jun 2006 19:12:41 -0400
Date: 2006-06-21T19:12:41-04:00	[thread overview]
Message-ID: <wcck67aumqe.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 8KOdnYaLZJaLMATZnZ2dnUVZ_tydnZ2d@megapath.net

"Randy Brukardt" <randy@rrsoftware.com> writes:

> I forget the exact reason that Elaborate_Body doesn't work, but the effect
> is that you can't count on it to eliminate elaboration problems completely.

Hmm.  Dispatching calls at elab time, maybe?  Elab_Body does ensure that
the body will be elaborated before all clients.

>    (a) make your package Preelaborate if possible (Pure is so limited that
> no real packages ever qualify) -- but this is usually impossible because I/O
> and Calendar aren't Preelaborate. Which means that you can't trace or log a
> Preelaborate package (well, there *is* one way to do it, but it adds runtime
> overhead);

I have put debug output code in Pure and Preelab packages by "cheating".
Like this: write a simple I/O package (I like to avoid the complexity
of Text_IO).  Use pragma Export(Ada) on all of its procedures.
Then write another package that declares all the same procedures,
with pragma Import(Ada), and put pragma Pure in that.

This is cheating, so I only do it for temporary debugging output.

- Bob



  parent reply	other threads:[~2006-06-21 23:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 12:33 Elaboration worries Alex R. Mosteo
2006-06-21 18:01 ` Samuel Tardieu
2006-06-21 20:34 ` Randy Brukardt
2006-06-21 23:07   ` Samuel Tardieu
2006-06-22 23:06     ` Randy Brukardt
2006-06-23 18:42       ` Samuel Tardieu
2006-06-23 19:54         ` Randy Brukardt
2006-06-21 23:12   ` Robert A Duff [this message]
2006-06-22 23:09     ` Randy Brukardt
2006-06-21 23:07 ` Robert A Duff
2006-06-22  2:24   ` Matthew Heaney
2006-06-22 10:36 ` Alex R. Mosteo
2006-06-22 16:25   ` Alex R. Mosteo
2006-06-22 23:31   ` Randy Brukardt
replies disabled

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