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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,8147e9052e4bc0df X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feedme.ziplink.net!news.swapon.de!aioe.org!not-for-mail From: =?iso-8859-15?Q?Yannick_Duch=EAne_=28Hibou57=29?= Newsgroups: comp.lang.ada Subject: Re: Child vs nested package : efficiency matter Date: Tue, 01 Jun 2010 21:56:01 +0200 Organization: Ada At Home Message-ID: References: <4281c262-d761-4373-930a-39c973f1fb48@q36g2000prg.googlegroups.com> <46fd21ad-347d-48c2-945b-72e3d1fcef79@t34g2000prd.googlegroups.com> NNTP-Posting-Host: 7g+UIcN0UM67WCCZrTfU2A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news2.google.com comp.lang.ada:12182 Date: 2010-06-01T21:56:01+02:00 List-Id: Le Tue, 01 Jun 2010 21:44:46 +0200, Adam Beneschan a = =E9crit: > It was just a theory. My thinking was that if you have a global > variable in a package *body* (and no subunits), a compiler can, in > theory, draw some conclusions about how the variable is used, since > there can be no uses of the variable except by subprograms in the > package body, and perhaps perform some optimizations based on that. > This doesn't work if the variable is in the spec (even in the private > part), since the compiler won't know what child packages might be > added later that have access to the variable. Anyway, this was just a= > theory, not really based on any experience. While this could be, theoretically, also possible to do global = optimization (SmallEiffel and its successor SmartEiffel compiler did = this), compiling a program as a whole. I understand what you mean, it's obvious. -- = There is even better than a pragma Assert: a SPARK --# check. --# check C and WhoKnowWhat and YouKnowWho; --# assert Ada; -- i.e. forget about previous premises which leads to conclusion -- and start with new conclusion as premise.