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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 22 Apr 2019 15:05:11 -0500 Subject: Re: Why can't objects be static in Ada? Newsgroups: comp.lang.ada References: <1127d366-d36c-4abf-8590-4b8c0e2b5446@googlegroups.com> From: Norman Worth Date: Mon, 22 Apr 2019 14:05:10 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: <1127d366-d36c-4abf-8590-4b8c0e2b5446@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-shMfYi3aZWsG+13KT5JTtgX8XCtNKzm3zjlnUV5KxF9x04PzEGbjA9jHkWUPUZT+ZPN7UHkseOAwEDq!X86+VGRqZ2xvp6/qXESvgmQNhkVG+biZRKmC9rD9M+NtKSIKBRZ91kQWXfZCwS04kVbjG/vjFnd7 X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2661 Xref: reader01.eternal-september.org comp.lang.ada:56174 Date: 2019-04-22T14:05:10-06:00 List-Id: Mark Lorenzen wrote: > On Tuesday, April 16, 2019 at 3:40:45 AM UTC+2, Randy Brukardt wrote: >>> >>> package Static is >>> pragma Preelaborate; >> >> I view this as self-inflicted, because there's no little value to pragma >> Preelaborate. As I previously noted, compilers will almost always generate >> the best possible elaboration code whether or not that pragma is applied. >> And regardless of C.4, not all preelaborated code can be done before load >> time, so it isn't providing a benefit in forcing that sort of code, either. >> >> It's one of the ideas where Ada tried to accomplish something, but didn't >> quite succeed. Pure is like that as well, but at least it provides some >> benefits for Annex E code. Preelaborate doesn't even do that. > > How can it be ensured that a library written in Ada does not require any elaboration. Pragma Pure? I think that such libraries are "nice" but pragma Pure is too restrictive for that purpose. In such cases it would be good, if e.g. the OP's problem could be solved at compile time without any elaboration. > > Regards, > Mark L > Something that these pragmas do (perhaps the only thing) is to insure that the code you write meets the requirements of the pragma. (Some compilers may not even ensure this.)