From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,16e3a8dd4f3ab3f3 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Elaboration order Date: 1996/03/15 Message-ID: #1/1 X-Deja-AN: 142915561 references: <314701A1.469D@lfwc.lockheed.com> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-03-15T00:00:00+00:00 List-Id: In article <314829CD.4FA9@lfwc.lockheed.com> Ken Garlington writes: > Can I get a Program_Error on the initialization of X? If so, it > would seem like there would need to be a pragma Elaborate for > nearly every reference to every package exporting a subprogram! Yes, annd no. IF you call a function from one package in the spec of some other package you certainly need a pragma Elaborate or pragma Elaborate_All. If such a function (or a procedure) is used in the sequence of statements of the package body, or if you call subprograms declared earlier in the package there, or if you initialize objects in the package body using functions from some other package, you may need the pragmas as well. BUT, and this is what makes it so painless, either your program runs or you get PROGRAM_ERROR right off the bat, so leaving out a (potentially) required pragma Elaborate is pretty harmless. (Unless you don't have a debugger that will tell you where the PROGRAM_ERROR came from.) If you prefer, you can choose not to initialize objects in packages with function calls, and not to have sequences of statements in package bodies, but that is throwing the baby out with the bath water. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...