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,fc67383cc0841f25 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!j19g2000vbp.googlegroups.com!not-for-mail From: Petter Newsgroups: comp.lang.ada Subject: Re: Rep Specing Variant Records Date: Wed, 16 Sep 2009 01:19:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <2009091520225816807-rblove@airmailnet> NNTP-Posting-Host: 83.183.49.8 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1253089194 15285 127.0.0.1 (16 Sep 2009 08:19:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 16 Sep 2009 08:19:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j19g2000vbp.googlegroups.com; posting-host=83.183.49.8; posting-account=ACEctQoAAAD3d42JSpp6_fpg88BhdFDo User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8344 Date: 2009-09-16T01:19:54-07:00 List-Id: Yes, discriminants do take up size. This is how I would do it: type Stuff (Has_Extra : Boolean) is record =A0 =A0 Foo : Integer; =A0 =A0 Bar : Integer; =A0 =A0 case Has_Extra is =A0 =A0 =A0 =A0 when True =3D> =A0 =A0 =A0 =A0 =A0 =A0 Blah : Float; =A0 =A0 =A0 =A0 when False =3D> =A0 =A0 =A0 =A0 =A0 =A0 null; =A0 =A0 end case; end record; for Stuff use record Has_Extra at 0 range 0 .. 31; =A0 =A0 Foo at 4 range 0 .. 31; =A0 =A0 Bar at 8 range 0 .. 31; Blah at 12 range 0 .. 31; end record; type Other_Stuff (Has_Blah : Boolean) is record Foo : Integer; Bar : Integer; case Has_Blah is when True =3D> Blah : Float; when False =3D> Blip : Integer; end case; end record; for Other_Stuff use record Has_Blah at 0 range 0 .. 31; Foo at 4 range 0 .. 31; Bar at 8 range 0 .. 31; Blah at 12 range 0 .. 31; Blip at 12 range 0 .. 31; end record;