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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c532be6870ab0c33 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Enumerations and rep-clauses? Date: 2000/02/28 Message-ID: <38BABF5D.A278EF9A@averstar.com>#1/1 X-Deja-AN: 590954037 Content-Transfer-Encoding: 7bit References: <38ba8b87.252446008@news.rrds.co.uk> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@inmet2.burl.averstar.com X-Trace: inmet2.burl.averstar.com 951762782 24042 141.199.8.164 (28 Feb 2000 18:33:02 GMT) Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 NNTP-Posting-Date: 28 Feb 2000 18:33:02 GMT Newsgroups: comp.lang.ada Date: 2000-02-28T18:33:02+00:00 List-Id: Steve Folly wrote: > > Hi, > > Given the following Ada95 situation... > > type enum is ( a, b, c, d ); > > for enum use ( a => 12, b => 24, c => 36, d => 48 ); > > subtype half_enum is enum range a .. b; > > Is it guaranteed anywhere that half_enum has the same representation attributes > as enum? (ie. half_enum(a) => 12 and half_enum(b) => 24) Yes. > > I would hope it did, but I'm having trouble finding the particular LRM > paragraph. An enumeration representation clause specifies a "type-related" aspect of representation, so it is shared by all subtypes. See RM95 13.1(8) which indicates that all rep clauses other than Size and Alignment clauses are type-related. (Size and Alignment are subtype-specific.) > > Thanks for your help. > > -- > Regards, > Steve Folly. > mailto:Steve.Folly@rdel.co.uk -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA