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: a07f3367d7,f7c38a023cf370dc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Should representation clauses be complete for each bit? Date: Wed, 27 Jul 2011 19:03:54 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <73c10395-ec4f-4a02-b0fc-e35bc14424fa@e18g2000vbx.googlegroups.com> <4e26f324$0$6549$9b4e6d93@newsspool4.arcor-online.net> <4606c5b0-7da1-43d0-a490-ba842f7621f7@hd10g2000vbb.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1311811437 25007 69.95.181.76 (28 Jul 2011 00:03:57 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 28 Jul 2011 00:03:57 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6109 Xref: g2news2.google.com comp.lang.ada:21359 Date: 2011-07-27T19:03:54-05:00 List-Id: "okellogg" wrote in message news:4606c5b0-7da1-43d0-a490-ba842f7621f7@hd10g2000vbb.googlegroups.com... >On 23 Jul., 02:13, "Randy Brukardt" 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.