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,7c47766edd175974 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-03 12:14:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!colt.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: How do package body initializers get run in GNU Ada? Date: 03 Nov 2002 20:14:59 +0000 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: <3DC31EBB.2050809@math.jpl.nasa.gov> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1036354493 3687 62.49.19.209 (3 Nov 2002 20:14:53 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 3 Nov 2002 20:14:53 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:30324 Date: 2002-11-03T20:14:59+00:00 List-Id: russian_power@hotmail.com (Romanov) writes: > I thought it was done when the package was being elaborated? Package > elaboration takes place when the package is instantiated. statements > like 'with text_io;' executes the body initializers. I am pretty sure that "with text_io;" will only execute the spec elaboration -- which is why you have to be careful when your initialization calls functions in other packages, cos the _body_ of the other package needs to have been elaborated. > but i use the dynamic elaboration feature in gnat. so much easier... > you only get a problem when you try to use another joker who uses > static elaboration instead... This seems odd to me, it's loads easier to let GNAT do its own thing and not have to worry. I admit that a program of ours that built fine under 3.09 caused us a lot of grief when we tried to migrate to 3.12 -- so much so that we stayed with 3.09 until we had to port to Solaris x86, with no possible way of building a 3.09 compiler. I can also see that if you want portability to other compilers you might have to be explicit ..