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/25 Message-ID: #1/1 X-Deja-AN: 237364270 References: <528878564wnr@diphi.demon.co.uk> <336089AF.6046@elca-matrix.ch> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1997-04-25T00:00:00+00:00 List-Id: In article <336089AF.6046@elca-matrix.ch> Mats Weber writes: > IMO, state of the art belongs in the standard, not in nice compiler > specific features, which would have allowed the standard to take a > different approach: automatic elaboration order consturction with > pragmas to _override_ it, instead of pragmas to do the right thing in > the most basic cases. No. State of the art should not be outlawed, and both Ada 83 and Ada 95 went along with that. But state of the art also argues for "letting a milion flowers bloom," until one prefered method emerges as "the state of the practice." There are Ada programs where not only is finding a workable elaboration order hard--in the mathematical sense--but a property of the program. Right now, the program designer has access to information not visible in the program, and based on that information there is a working elaboration order. But... Let me give you a true life example. The system archictecture has a design philosophy where each level in the architect only depends on state in a lower level. But for implementation reasons, lower level routines call upper level routines all over the place. As long as elaboration is done in the right order, from lowest level to highest, there are no ABE problems. But assigning programs to levels is not something the compiler can easily do. Sound like an extreme case? Sorry, most graphical interfaces are structured this way. Accidently, breaking those ordering rules becomes an obvious bug at run-time. In Ada, using the extra-linguistic knowledge to do elaboration means that, if it compiles, you won't have ABE problems. Since the Ada model is so much easier to life with than the model in some other languages, I'm willing to put up with the minor irritation to allow these programs to be written. (The problem when you find a circular elaboration dependency and have to fix it is not minor. But in Ada you haven't spent months tracking it down.) Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is... -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...