From: R.B. Love <rblove@airmail.net>
Subject: Rep Specing Variant Records
Date: Tue, 15 Sep 2009 20:22:58 -0500
Date: 2009-09-15T20:22:58-05:00 [thread overview]
Message-ID: <2009091520225816807-rblove@airmailnet> (raw)
I want to understand how a variant record gets rep spec'd. Let's say I
have a sample of my record:
type stuff(has_extra:boolean) is
record
foo: integer;
bar: integer;
case has_extra
when true =>
blah : float;
when false =>
null;
end case;
end record;
for stuff use
record
foo at 0 range 0..31;
bar at 4 range 0..31;
end;
type normal_stuff is new stuff(has_extra=>false);
type good_stuff is new stuff(has_extra=>true);
for good_stuff use
record
blah at 12 range 0..31;
end record;
for normal_stuff'size use 64; -- 8 bytes
for good_stuff'size use 96; -- 12 bytes
First, does the discriminant take up any size in the record? When I
tried this with a tagged record, I was told that my placement at 0
bytes off set classed with the tag. That's no good.
Second, does the layout of normal_stuff look like I expect it would,
that is, the same as stuff?
Does the good_stuff record have a complete rep spec?
Thanks for any replies. I see books covering the rep spec of plain
records but none seem to cover variant records.
next reply other threads:[~2009-09-16 1:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 1:22 R.B. Love [this message]
2009-09-16 8:19 ` Rep Specing Variant Records Petter
2009-09-16 10:10 ` Martin
2009-09-16 15:03 ` Adam Beneschan
2009-09-17 2:39 ` Robert Love
2009-09-17 6:57 ` Niklas Holsti
2009-09-17 8:25 ` Martin
2009-09-18 2:28 ` Robert Love
2009-10-10 2:49 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox