From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org.POSTED!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: deferred constants Date: Wed, 07 Jul 2021 18:21:34 -0700 Organization: Aioe.org NNTP Server Message-ID: <86v95l8ush.fsf@stephe-leake.org> References: <5db8eeb4-f3fc-49a7-b588-6a4b25bdbafcn@googlegroups.com> <2e09faca-1f9a-43d3-99cb-6ae0e27a741cn@googlegroups.com> <4333d2e6-a4f6-46a8-a5df-78bb4e0d915en@googlegroups.com> NNTP-Posting-Host: pBWEO6hi52oGFheO/GY5ag.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt) Cancel-Lock: sha1:jme82x04v7KW+4ZdnaeKdOBnZWg= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader02.eternal-september.org comp.lang.ada:62348 List-Id: Matt Borchers 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