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,UTF8 X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109 Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Should representation clauses be complete for each bit? Date: Thu, 21 Jul 2011 09:22:13 +0100 Organization: A noiseless patient Spider Message-ID: References: <73c10395-ec4f-4a02-b0fc-e35bc14424fa@e18g2000vbx.googlegroups.com> <4e26f324$0$6549$9b4e6d93@newsspool4.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="18177"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ODFicYGEd2fQY+WMX2uUb4osnNJuTIl4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:JNsL4ti9i2oCVARZJfUWDTZVqaI= sha1:Vd3E2HceSOKYTOHnoj931gCmDDE= Xref: g2news2.google.com comp.lang.ada:21231 Date: 2011-07-21T09:22:13+01:00 List-Id: Martin writes: > 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 Presumably if something took only three bits you'd have to say that much at least. And would it be 'Size or 'Object_Size? (remembering that Natural'Size {used to be,is} Integer'Size - 1). Wouldn't pragma Pack do this? It may be that *if you need to specify a representation* this is a common use case (I don't remember it being so), but needing to specify a representation is pretty rare anyway. And so it should be, after all it should only happen at the edges, well hidden from the bulk of the application.