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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5dba30d6260ef552 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Elaboration Order Date: 1999/11/15 Message-ID: <80pcdf$7u5$1@nnrp1.deja.com>#1/1 X-Deja-AN: 548859075 References: X-Http-Proxy: 1.0 x36.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Nov 15 16:29:42 1999 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-11-15T00:00:00+00:00 List-Id: In article , "Wolf-Dieter Heker" wrote: > Hence I would suggest that these packages should contain an > elaborate_body pragma (except, of course, if the have no body). But alas, > most programmers - including myself ;-) - do not write these pragmas until > the get into trouble. Well then they are not following standard coding guidelines, which is to use pragma Pure if possible, and if not possible, use pragma Preelaborate, and if not possible use pragma Elaborate_Body. > The lack of these pragmas is a portability issue. Of course the static elaboration model of GNAT eliminates this portability issue, especially if you follow the ELaborate_All guidelines suggested by -gnatwl. > And isn't it true that if > a package body cannnot be elaborated immediately after the spec we have > generally a doubtful design? No, it is common to have package bodies that are mutually recursive, and there is nothing whatsoever doubtful about such a design. > Now my major question: Why didn't the language designers choose an approach > that would make the standard case easy and provide a pragma > defer_elaboration_of_body for those rare cases, where the user doesn't want > the body elaborated immediately after the spec? Because they are not so rare > Is there more reason that > just compatibility with the user unfriendly definition of > Ada83? I see nothing especially unfriendly here, and it is not at all obvious what the right solution is here. Programs that use elaboration sparingly usually have little trouble. THe supposedly user friendly suggestion you give of the defer pragma would be a huge pain in the neck and result in piles of pragmas for programs that do not need pragmas now. Remember you only need elaborate pragmas if you actually call routines during elaboration. Your pragma would need to be used all over the place even in a program that HAD no elaboratoin code at all. To see an alternative approach, read the chapter on elaboration in the GNAT RM. Sent via Deja.com http://www.deja.com/ Before you buy.