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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,269df2c167555fd6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-24 09:47:09 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!newsfeed.berkeley.edu!ucberkeley!hammer.uoregon.edu!newsfeed.direct.ca!look.ca!wn1feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc07-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3A97F419.6E2F075@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada 0x: Re: Representation clause References: <3a95c52f@post.usenet.com> <3A95E095.75B2A248@worldnet.att.net> <3a9621eb$1@pull.gecm.com> <3A974A99.469AE413@worldnet.att.net> <87wvagweck.fsf@deneb.enyo.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 24 Feb 2001 17:47:07 GMT NNTP-Posting-Host: 12.74.130.224 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc07-news.ops.worldnet.att.net 983036827 12.74.130.224 (Sat, 24 Feb 2001 17:47:07 GMT) NNTP-Posting-Date: Sat, 24 Feb 2001 17:47:07 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.ada:5512 Date: 2001-02-24T17:47:07+00:00 List-Id: My assertion that Program_Error will be raised is based upon the result of tests using GNAT 3.13p. Note that my code does NOT rely on that or any other exception being raised to run properly. It detects the erroneous condition without causing any exception to be raised. It does raise its own exception when an erroneous condition is detected. I admit that I may have generalized the response too much based upon testing with one compiler. On the other hand, my solution does not rely on that generalization. I therefore feel that my solution is only half bad :-). Jim Rogers Colorado Springs, Colorado Florian Weimer wrote: > > James Rogers writes: > > > If the following is attempted, Program_Error will be raised at run-time. > > > > function Convert is new Ada.Unchecked_Conversion(Source => Integer, > > Target => Colors); > > > > Enum_Value : Colors := Convert(2); > > Eh, could you provide a RM reference which supports your claim? I > don't think you can rely on a Program_Error exception in such cases. > Constraint_Error might be raised as well, or no exception at all.