From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Should representation clauses be complete for each bit?
Date: Wed, 27 Jul 2011 19:03:54 -0500
Date: 2011-07-27T19:03:54-05:00 [thread overview]
Message-ID: <j0q91d$odf$1@munin.nbi.dk> (raw)
In-Reply-To: 4606c5b0-7da1-43d0-a490-ba842f7621f7@hd10g2000vbb.googlegroups.com
"okellogg" <okellogg@users.sourceforge.net> wrote in message
news:4606c5b0-7da1-43d0-a490-ba842f7621f7@hd10g2000vbb.googlegroups.com...
>On 23 Jul., 02:13, "Randy Brukardt" <ra...@rrsoftware.com> wrote:
>> [...]
>> I understand the complaint here, but I still think that explictly
>> specifying the bit packing in this way is best. The syntax that requires
>> mentioning both the low and high bits is overkill, but that has nothing
>> to
>> do with this particular issue -- it is overkill for *any* record. We
>> really
>> need an alternative shorter syntax for these lines in a record
>> representation clause:
>>
>> Gap1 at 0 bit 1;
>>
>> or something like that. No one ever wants to give the high bound in these
>> clauses -- it's almost pointless and a real pain if it might change (note
>> the most general form given above).
>
>So the number given after "bit" is the starting bit? I like that idea.
Right. The big problem with this is finding the right keyword to use (I
don't think any of the existing ones work, I looked over the list before
posting the above).
>(Well, after all we still need to be aware of sizes, be it just to
>figure out the next available starting bit.)
True enough. If we really wanted the size indicated, we ought to do that
directly:
Gap1 at 0 bit 1 size 2;
because calculating it is a pain, especially when the size is a named
constant and not a literal.
One of the largest mistakes I made in designing the intermediate code for
Janus/Ada was copying the record representation clause too closely; the
design should have been the same as the above, not the first and last bits
of the record rep. clause. That's because the first and last bit design
doesn't work for packed array indexing (everything is variable and thus you
don't know what size code to generate), while the size of the component is
probably a constant.
That seems true for the design of the record rep. clause as well.
But I suspect it won't get changed, because it is "insufficiently broken".
Someone would have to make a pretty good case that there is a problem, and
I'm not sure that can be done.
Randy.
next prev parent reply other threads:[~2011-07-28 0:03 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-20 10:34 Should representation clauses be complete for each bit? okellogg
2011-07-20 14:51 ` Robert A Duff
2011-07-20 15:24 ` Georg Bauhaus
2011-07-20 17:28 ` Robert A Duff
2011-07-21 7:37 ` Martin
2011-07-21 8:22 ` Simon Wright
2011-07-21 14:58 ` Robert A Duff
2011-07-23 0:13 ` Randy Brukardt
2011-07-27 14:12 ` okellogg
2011-07-28 0:03 ` Randy Brukardt [this message]
2011-07-21 9:43 ` Georg Bauhaus
2011-07-21 15:06 ` Robert A Duff
2011-07-31 15:02 ` BrianG
2011-07-21 21:11 ` Brian Drummond
2011-07-21 7:59 ` Stephen Leake
2011-07-20 15:29 ` okellogg
2011-07-20 16:24 ` Dmitry A. Kazakov
2011-07-20 16:58 ` okellogg
2011-07-20 19:38 ` Dmitry A. Kazakov
2011-07-20 17:27 ` Robert A Duff
2011-07-20 19:14 ` okellogg
2011-07-20 20:13 ` J-P. Rosen
2011-07-20 21:23 ` Robert A Duff
2011-07-20 21:21 ` Robert A Duff
2011-07-21 8:02 ` Stephen Leake
2011-07-21 8:00 ` Stephen Leake
2011-07-21 7:36 ` Martin
2011-07-22 23:50 ` Randy Brukardt
2011-07-23 2:16 ` tmoran
2011-07-23 15:12 ` Robert A Duff
2011-07-26 21:10 ` Randy Brukardt
2011-07-23 0:01 ` Randy Brukardt
-- strict thread matches above, loose matches on Subject: below --
1998-04-17 0:00 Should Representation Clauses " Marin David Condic, 561.796.8997, M/S 731-96
[not found] <3533C3C5.3F25CB91@cacd.rockwell.com>
1998-04-16 0:00 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox