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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3a414836333dfef7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-07 16:00:50 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Elaboration in GNAT Date: 7 Jan 2002 16:00:49 -0800 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0201071600.475f4618@posting.google.com> References: <1006952193.650930@edh3> <5ee5b646.0111281125.7e9fbca3@posting.google.com> <1010151875.216658@edh3> <5ee5b646.0201041650.208d0918@posting.google.com> <3C39D954.58672C0A@Raytheon.com> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1010448049 26866 127.0.0.1 (8 Jan 2002 00:00:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 8 Jan 2002 00:00:49 GMT Xref: archiver1.google.com comp.lang.ada:18630 Date: 2002-01-08T00:00:49+00:00 List-Id: Mark Johnson wrote in message news:<3C39D954.58672C0A@Raytheon.com>... > Robert Dewar wrote: > > > > Some things to remember here: > > > > 1. The static elaboration model of GNAT is primarily intended for the development of new code. > Hmm. I guess I disagree with that statement. See reasons > below. You can't really disagree with the designer of a feature telling you its primary design intention :-) Of course it is just fine if it can be used for legacy code, and it is always good to hear of such successes. > > 3. If you are working with legacy code, it often makes > > no sense to try to use the static model of GNAT Often /= never! My point, which I guess was confusing was that it often does not make sense to put in a huge amount of work to restructure code to meet the static model > Yes and no. Two examples follow. i.e. you are agreeing, sometimes yes, and sometimes no, which is exactly what I was saying > As Robert's message goes on to say - complicated > elaboration code is likely filled with bugs anyway. = That's misreading my message, the bugs I was talking about are failure to have all the pragma Elaborate's in place, but that is very specific. The paradigm that causes most trouble with the static model is: with X; package Y is ... Q : integer := X.Func; ... where X is a giant package with a large number of with's, but you happen to know that Func is a little function that does not use any of these with's. So it is in fact safe to use pragma Elaborate, instead of pragma Elaborate_All and everything will work. The coding philosophy of the static model of GNAT rejects this coding style on the grounds that it is improper for a client of X to know anything about the implementation of the body of X (and any of its subprogram). Yes, that's a legitimate coding philosophy, but that does not mean that any code that does not follow this philosophy is buggy :-) That being said, any program which does a lot of computation at elaboration time is worrisome. That's especially so if you have library tasks, which can start up before elaboration is complete :-( (see special section on elaboration and tasking in the GNAT docs). Robert Dewar