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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:720b:: with SMTP id n11mr2433244ioc.3.1555163333841; Sat, 13 Apr 2019 06:48:53 -0700 (PDT) X-Received: by 2002:aca:c30f:: with SMTP id t15mr13495911oif.157.1555163333584; Sat, 13 Apr 2019 06:48:53 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!136no223638itk.0!news-out.google.com!w17ni283itb.0!nntp.google.com!b2no224682itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 13 Apr 2019 06:48:53 -0700 (PDT) In-Reply-To: <842b24b2-4b9f-46ae-a173-87b70aac2959@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:c7d:3c35:b000:325a:3aff:fe0f:37a5; posting-account=L2-UcQkAAAAfd_BqbeNHs3XeM0jTXloS NNTP-Posting-Host: 2a02:c7d:3c35:b000:325a:3aff:fe0f:37a5 References: <842b24b2-4b9f-46ae-a173-87b70aac2959@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Why can't objects be static in Ada? From: Lucretia Injection-Date: Sat, 13 Apr 2019 13:48:53 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56129 Date: 2019-04-13T06:48:53-07:00 List-Id: On Saturday, 13 April 2019 14:07:13 UTC+1, Jere wrote: > On Thursday, April 11, 2019 at 8:40:40 AM UTC-4, Lucretia wrote: > > Zero_Size : constant Sizes :=3D (others =3D> Natural_Dimension'First= ); > >=20 > > Why can't Zero_Size be compiled as static in this pre-elaborated packag= e? > >=20 > > This seems to be a major flaw in Ada imo. > >=20 > > Luke. >=20 > Out of curiosity, are you looking for something more akin to C++'s > constexpr [1][2] keyword? Ada's static definition is kind of like that,= =20 What I'm after is for the compiler to compile a constant, which as can be s= een has it's components initialised from other constants, such that I can t= hen pass the overall constant like Zero_Size, into a generic, in which the = whole outer package is pre-elaborated. > but not as flexible or usable yet. I'm hoping that at some point Ada=20 > does adjust the definition of static to be even more useful. Most=20 I can't believe, in 40 years, nobody has come up against this issue before. I suppose maybe that constexpr function modifier would be helpful here too,= but really the data should be considered static, as in, clearly defined at= compile time.