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,f7c38a023cf370dc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news-transit.tcx.org.uk!feeder.news-service.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 21 Jul 2011 11:43:22 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Should representation clauses be complete for each bit? References: <73c10395-ec4f-4a02-b0fc-e35bc14424fa@e18g2000vbx.googlegroups.com> <4e26f324$0$6549$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <4e27f4ba$0$6584$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 21 Jul 2011 11:43:23 CEST NNTP-Posting-Host: e6f7e5a3.newsspool3.arcor-online.net X-Trace: DXC=:]RJWV6BZmdf1oJaJ0@dmgMcF=Q^Z^V3h4Fo<]lROoRa8kFjLh>_cHTX3jmUn0WnTYPCFe X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:21233 Date: 2011-07-21T11:43:23+02:00 List-Id: On 21.07.11 09:37, Martin wrote: > On Jul 20, 6:28 pm, Robert A Duff > wrote: >> Georg Bauhaus writes: >>> On 20.07.11 16:51, Robert A Duff wrote: >> >>>> By the way, I find Ada's representation clauses to be at the wrong >>>> level of abstraction. Why can't I just write a single line of code >>>> that means "put all the components in declaration order with no gaps >>>> in between"? >> >>> Is this a frequent use case? >> >> Yes, I think so. >> >> - Bob > > I think you're right, Bob. In fact, I'd go so far as to say it's very, > very common. > -- Martin More specifically, if the original example of "not all bits used and some gaps between them" is unusual, is it so - when mapping to a set of hardware pins, say? - or when "interfacing" to C structs? For C structs, declaration order seems very convenient, as C keeps declaration order. But C may well introduce gaps between structure components whenever its alignment rules requires. Then I will want gaps in Ada, too. Is a convention pragma sufficient, then?