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,6339fea48a1b8cda X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!79g2000hsk.googlegroups.com!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: Enumeration representation clause surprise. Date: Thu, 12 Jun 2008 01:27:45 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <48502e38$0$23821$4f793bc4@news.tdc.fi> <88GdnYlGypeb5M3VnZ2dnUVZ_hzinZ2d@comcast.com> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1213259266 25229 127.0.0.1 (12 Jun 2008 08:27:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 12 Jun 2008 08:27:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 79g2000hsk.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 webwasher (Webwasher 6.7.0.3295) Xref: g2news1.google.com comp.lang.ada:668 Date: 2008-06-12T01:27:45-07:00 List-Id: On 12 Jun., 03:16, tmo...@acm.org wrote: > >There's a "Note" in RM13.4(11/1) that says "Unchecked_Conversion > >may be used to query the internal codes used for an enumeration type". > Tom wrote: > =A0 =A0That, along with 13.4(7) "An enumeration representation clause > specifies the coding aspect of representation. =A0The coding consists of t= he > internal code for each enumeration literal, ..." =A0sure sounds to me like= > an Unchecked_Conversion should return the internal code set by the > enumeration representation clause, ie, the number 1 or number 2 in this > case. =A0The fact the variable in question is in a record shouldn't make > that false. This is a non sequitur. type My_Record is record I: My_Int; end record; for My_Record use record I at 0 range 0 .. 0; end record; Also in this case an Unchecked_Conversion gives different results for I declared as a record component or by itself. But I support the other reasons why the actual aspect clause should possibly be rejected.