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-Thread: 103376,85c4b961f840b5ab X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.jgaa.com!news.hacking.dk!pnx.dk!munin.nbi.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Zero length Objects Date: 30 Jun 2004 22:32:26 +0200 Organization: Munin Sender: sparre@sparre.crs4.it Message-ID: References: NNTP-Posting-Host: 80.241.165.35 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1088627547 31988 80.241.165.35 (30 Jun 2004 20:32:27 GMT) X-Complaints-To: sparre@munin.nbi.dk NNTP-Posting-Date: Wed, 30 Jun 2004 20:32:27 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:2010 Date: 2004-06-30T22:32:26+02:00 List-Id: Robert C. Leif wrote: > I am trying to create a means to report the value of experimental > parameters. I would like to store only those parameters that I have > selected. Since thanks to Robert I. Eachus, I am using a variant > record, I can set the parameter to null, which is presently stored > as 16 bits. I created an empty type; please see the small main > procedure below. I have not been able to have the size attribute > work directly on null. > > with Ada.Text_Io; > procedure Empty_Pkg is > package T_Io renames Ada.Text_Io; > type Empty_Type is > (Empty); > for Empty_Type'Size use 0; > Empty_Var : Empty_Type; > begin > T_Io.Put_Line("The size of empty is " & Integer'Image(Empty_Var'Size)); > > end Empty_Pkg; > > This produced: The size of empty is 8 I thought: type Even_Emptier_Type is null record; for Even_Emptier_Type'Size use 0; Even_Emptier_Var : Even_Emptier_Type; might be more effective, but no, also the size of Even_Emptier_Var is 8. :( Jacob -- "Banning open source would have immediate, broad, and strongly negative impacts on the ability of many sensitive and security-focused DOD groups to protect themselves against cyberattacks" -- Mitre Corp.