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,f9957894e0bdf128 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!a26g2000prf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: How to put 200 into an integer sub-type of 16 bits (code included) Date: Thu, 15 Jan 2009 08:28:29 -0800 (PST) Organization: http://groups.google.com Message-ID: <44178c17-a27b-48ff-8ff1-17d04d362ce4@a26g2000prf.googlegroups.com> References: <407ae64d-3cb3-4310-b59e-f1bbae9910a5@t39g2000prh.googlegroups.com> <71gqm49eatq868htrvd7eghm3m8su8kcbl@4ax.com> <7b017de2-951a-414a-8290-111353fe02f8@r15g2000prd.googlegroups.com> <46075a57-3445-44ae-b40e-dcad9e0e1fcf@v18g2000pro.googlegroups.com> <3d951e6e-c87d-4667-94ab-fcb312288e1d@r37g2000prr.googlegroups.com> <12837a65-dd6e-493f-91e8-4140d67237c2@z28g2000prd.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1232036909 23348 127.0.0.1 (15 Jan 2009 16:28:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 15 Jan 2009 16:28:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a26g2000prf.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:4298 Date: 2009-01-15T08:28:29-08:00 List-Id: On Jan 14, 7:09 pm, "Randy Brukardt" wrote: > "Adam Beneschan" wrote in message > > news:12837a65-dd6e-493f-91e8-4140d67237c2@z28g2000prd.googlegroups.com... > > > On Jan 14, 3:09 pm, Martin wrote: > >> On Jan 14, 9:16 pm, Adam Beneschan wrote: > > >> > Not necessarily. You can apply a 'Size clause to a subtype: > > >> > subtype Byte is Natural range 0 .. 255; > >> > for Byte'Size use 8; > > >> Since when??? > > > Since Ada 95 (I don't think this was allowed in Ada 83). See 13.1 > > (8). GNAT may not allow this, but 13.1(20) gives implementations the > > right to put their own restrictions on representation items. > > No, 13.3(48) says "Size may be specified for *first subtypes* ..." (emphasis > mine). Nothing about specifying it for non-first subtypes. (There has been > quite a bit of discussion about changing that, but it leads to uncomfortable > issues with legality rules depending on representation - not enough people > can live with that.) Wow, that's confusing when looking at 13.1(8). That says, "A representation item that names a subtype is either subtype-specific (Size and Alignment clauses) or type-related (all others). Subtype- specific aspects may differ for different subtypes of the same type". The clear implication of that seems to be that you can use a subtype- specific representation item to change certain aspects of subtypes so that they differ from those aspects of different subtypes of the same type. Yet the RM says for both Size and Alignment that they may be specified for "first subtypes", and nothing says they may be specified for other subtypes. What's the point of defining the term "subtype-specific representation item" if you can't make it subtype-specific? I'll accept that 13.3 (48) [and 13.3(25)] override any implications I may have read into 13.1 (8); but if that's true, then the whole concept of a "subtype-specific representation item", and probably the last two sentences of 13.1(8), appear to be a crock that ought to be purged from the RM. [Yes, there may still be subtype-specific *aspects*, but the second sentence of 13.1(8) clearly talks about subtype-specific *representation items*.] Anyway, I apologize to anybody for publicly disseminating misinformation about the language, but I hope you all understand how I got misled. Sigh....... -- Adam