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.6 required=5.0 tests=BAYES_00,FROM_WORDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6e6cdf6ff50e684 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-08 21:02:38 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!nntp.flash.net!news.flash.net!not-for-mail From: "Ken Garlington" Newsgroups: comp.lang.ada References: <95tqbh$ag7$1@nnrp1.deja.com> Subject: Re: Representation clause for enumeratives X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Fri, 09 Feb 2001 05:02:35 GMT NNTP-Posting-Host: 65.65.209.251 X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 981694955 65.65.209.251 (Thu, 08 Feb 2001 23:02:35 CST) NNTP-Posting-Date: Thu, 08 Feb 2001 23:02:35 CST Organization: FlashNet Communications, http://www.flash.net Xref: supernews.google.com comp.lang.ada:5039 Date: 2001-02-09T05:02:35+00:00 List-Id: As an aside, here's some fun you can have with the following package in GNAT 3.12p: : package Big_Enum is : : type Object is (A, B, C); : : for Object use( : 16#0000_0002#, : 16#0000_0004#, : 16#8000_0000# : ); : : for Object'Size use 32; : : end Big_Enum; -- This works: for Object use( 16#0000_0000#, 16#7FFF_FFFF#, 16#8000_0000# ); -- But change it to the following, and you get "value not in range of type 'Standard.Integer'" -- (I only changed the first value to -1; it's not in Standard.Integer? :) for Object use( -1, 16#7FFF_FFFF#, 16#8000_0000# ); -- This works fine.... for Object use( 1, 2, 16#FFFF_FFFF# ); -- But the following draws the Standard.Integer message... for Object use( -16#FFFF_FFFF#, -2, -1 ); Tsk - these limited enumeration representation ranges... :) I wouldn't mind this behavior in a numeric type... type Hardware_Numeric is range (-16#8000# .. 16#7FFF#) or ( 16#0000# .. 16#FFFF#); A : Hardware_Numeric := -1; -- all further literals must be in range of first clause... X : Hardware_Numeric := 16#8000#; -- all further literals must be in range of second clause... Get that into Ada 0Y for me, will ya? :)