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,baa6871d466e5af9 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: AQ&S Guidance on pragma Elaborate_Body Date: 1997/04/29 Message-ID: #1/1 X-Deja-AN: 238216574 References: <528878564wnr@diphi.demon.co.uk> <336089AF.6046@elca-matrix.ch> <01bc5260$373835e0$28f982c1@xhv46.dial.pipex.com> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1997-04-29T00:00:00+00:00 List-Id: I said: > And, yes, I have worked with programs where the "right" > elaboration order could only be determined from files read at > execution time. Of course the programming team knew the right order > and embedded it in Elaborates and project documentation. In article dewar@merv.cs.nyu.edu (Robert Dewar) writes: > I find this sort of thing bad programming practice. If you are > doing anything this fancy at elaboration time, it is likely to > get you into trouble, and you do better to make the "elaboration" > explicit rather than implicit, by introducing appropriate > explicit initialization routines. Unfortunately, in Ada 95 it is becoming more common, not because programmers want to, but because of the rules surrounding tagged types. If you need to have a tagged type declaration depend on read in from a file, especially for a controlled type, you have to open and read the file before the start of the main program. If you want to keep all the configuration information in a single file, you then have to control the order of elaboration. I don't find this particularly distressing. But it is makework in the sense that you should write "outer" exception handlers around every package body sequence of statements, instead of once for the main program. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...