comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: deferred constants
Date: Wed, 07 Jul 2021 18:21:34 -0700	[thread overview]
Message-ID: <86v95l8ush.fsf@stephe-leake.org> (raw)
In-Reply-To: 4333d2e6-a4f6-46a8-a5df-78bb4e0d915en@googlegroups.com

Matt Borchers <mattborchers@gmail.com> writes:

> I suppose I could just move the call to 'compile' out of the begin
> block of the package as people have suggested. At what point do
> constants defined by a function call get elaborated? Before or after
> the elaboration block? Might I then potentially encounter a
> elaboration race condition?

The Ada rules guarrantee no race condition, but sometimes fixing
elaboration order gets tricky. GNAT offers (at least) two elaboration
models; see the user guide. Normally, you just write the code, and only
worry about elaboration if the compiler reports a problem.

> The RENAME is interesting as I have not seen that before. Is it a
> rename of the function call (invokes the function upon reference) or a
> rename of the function result?

The result; if the rename was in a block in a loop, the function be run
once for each iteration of the loop.

-- 
-- Stephe

  parent reply	other threads:[~2021-07-08  1:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 19:31 deferred constants Matt Borchers
2021-07-07 20:40 ` Jeffrey R. Carter
2021-07-07 20:41 ` Stephen Leake
2021-07-07 20:44 ` Shark8
2021-07-07 23:15   ` Matt Borchers
2021-07-07 23:37     ` Shark8
2022-07-06 16:18       ` RegEx / rename of a function result Thomas
2022-07-06 17:56         ` J-P. Rosen
2022-07-06 19:11           ` Jeffrey R.Carter
2022-07-07  5:51             ` RegEx / rename of a function resultRig J-P. Rosen
2022-07-11 17:49           ` RegEx / rename of a function result Thomas
2022-07-12  5:13             ` J-P. Rosen
2022-07-12 14:45               ` G.B.
2022-07-07  0:44         ` Randy Brukardt
2022-07-11 17:45           ` Thomas
2022-07-12  6:54             ` Randy Brukardt
2021-07-08  1:21     ` Stephen Leake [this message]
2021-07-08 14:18       ` deferred constants Maxim Reznik
replies disabled

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