From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Did I find a bug here? Date: Sat, 3 Apr 2021 14:37:08 +0200 Organization: Adalog Message-ID: References: <6901cec3-b7b1-48c8-98fe-0360572175c2n@googlegroups.com> <2bb293da-8c8d-471c-ab0a-93fbc0033485n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 3 Apr 2021 12:37:08 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="b8a8cf8af9326e70b93de8105a2d8fa4"; logging-data="14917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nVncls17WxZKYmZCjvPjS" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 Cancel-Lock: sha1:1Ot/Gu1KhRwWkF+2xWdme8tTFJo= In-Reply-To: Content-Language: fr Xref: reader02.eternal-september.org comp.lang.ada:61733 List-Id: Le 03/04/2021 à 10:18, Niklas Holsti a écrit : > On 2021-04-03 9:41, J-P. Rosen wrote: >> Le 03/04/2021 à 07:46, reinert a écrit : >>> Could AB_Type(X) in "case AB_Type(X) is" function as such a valid check? >> Yes, > > > I believe not. The use of X as an argument to a type conversion is an > "evaluation" of X, by RM 4.6(28), which can be a bounded error by RM > 13.9.1(9) if X'Valid is False. > > That bounded error can lead to an exception or simply to continued > execution with the invalid value. > Hmm, yes. I was thinking about eliminating "when others" because the intended range was covered. If you want to check for invalid values, 'Valid is the only way to go (that's why it was added to the language!) -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr