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!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: Why can't objects be static in Ada? Date: Sat, 13 Apr 2019 20:47:28 -0700 Organization: None to speak of Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="230b1f2e324f5760103406bdc71625a1"; logging-data="8935"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mXoa5aPLAcOYx65/g8d5Q" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:oGo8IfZKABm2sXur5dui5OGtycE= sha1:DRnOFxg05+BLCPBafHtZyehqfn0= Xref: reader01.eternal-september.org comp.lang.ada:56130 Date: 2019-04-13T20:47:28-07:00 List-Id: Lucretia writes: > Someone sent in a pull request to my bindings and had to change a few > constants to functions because objects can't be static. For an > example: > > type Sizes is > record > Width : Dimension; > Height : Dimension; > end record with > Convention => C; > > Zero_Size : constant Sizes := (others => Natural_Dimension'First); > > Why can't Zero_Size be compiled as static in this pre-elaborated > package? What exactly do you mean by "static"? That word has very different meanings in C and Ada. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */