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-26 11:52:20 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!newsengine.sol.net!homer.alpha.net!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada 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> <3A97F419.6E2F075@worldnet.att.net> Subject: Re: Ada 0x: Re: Representation clause X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 Message-ID: <3tym6.3352$7e6.1360491@homer.alpha.net> Date: Mon, 26 Feb 2001 13:51:03 -0600 NNTP-Posting-Host: 156.46.62.124 X-Complaints-To: abuse@alpha.net X-Trace: homer.alpha.net 983217087 156.46.62.124 (Mon, 26 Feb 2001 13:51:27 CST) NNTP-Posting-Date: Mon, 26 Feb 2001 13:51:27 CST Xref: supernews.google.com comp.lang.ada:5539 Date: 2001-02-26T13:51:03-06:00 List-Id: James Rogers wrote in message <3A97F419.6E2F075@worldnet.att.net>... >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. Basing it on the RM, rather than a particular compiler, would be better. >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 :-). Why didn't you use the 'Valid attribute for the check? Then you can can avoid the erroneous behavior. (Your current code is erroneous if the representation is out of range, and while it *probably* will work on all Ada compilers, there is no guarentee of that.) Randy Brukardt.