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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fx21.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:30.0) Gecko/20100101 Thunderbird/30.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: When enumeration representation clause is too late? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Mon, 18 Aug 2014 16:47:30 UTC Organization: TeraNews.com Date: Mon, 18 Aug 2014 10:47:23 -0600 X-Received-Bytes: 2155 X-Received-Body-CRC: 4150790953 Xref: news.eternal-september.org comp.lang.ada:21807 Date: 2014-08-18T10:47:23-06:00 List-Id: On 17-Aug-14 23:13, J-P. Rosen wrote: > Le 17/08/2014 23:38, Victor Porton a écrit : >> When enumeration representation clause is too late and so must be >> disallowed? >> >> From compiler writer's perspective, it is clear that enumeration >> representation clause should not be after calling an enum value. >> >> But I have not found such a rule in the ARM-2012. >> > A representation clause on a type is not allowed after the type is frozen. > > Freezing rules are described in 13.14. Advice: choose a good arm-chair > and grab a mug of coffee before you start reading this paragraph. One thing that would be kind of nice is a "deferred" aspect which would allow the representation of an enumeration to be specified in the private section. -- This would allow the grouping of types and subtypes w/o having to intersperse representation clauses between them and also keep them in the private section where I believe is their proper place. NOT CURRENTLY LEGAL ADA: Package K is Type Device_States is ( Missing, Standby, Ready, Unknown ) with Deferred; Subtype Integrated_Device is Device_States range Standby..Unknown; Private For Device_States use ( Missing => 2#000#, Standby => 2#100#, Ready => 2#101#, Unknown => 2#111# ); End K;