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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: I am not understanding user defined exceptions Date: Sat, 4 Feb 2017 07:58:43 +0100 Organization: A noiseless patient Spider Message-ID: References: <6cb6e781-c6df-4962-99e3-760e7c7fab88@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 4 Feb 2017 06:57:00 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a961b28d800401850710a1ec34fe1a69"; logging-data="622"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pYmo1Cisb3qyZmY7zdmHx" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 In-Reply-To: Cancel-Lock: sha1:UvtiqRkFdI+pADUYwhsv817PbFE= Xref: news.eternal-september.org comp.lang.ada:33238 Date: 2017-02-04T07:58:43+01:00 List-Id: Le 04/02/2017 à 02:26, Dennis Lee Bieber a écrit : > If you always need to have input of a 1 raise the exception, you need > to encapsulate the input with the test. See below: Or is the logic of your program is that x should never contain 1, declare a subtype with that property: subtype Exclude_One is integer with static_predicate Exclude_One /= 1; and declare x of that subtype. The predicate will be checked every time you set the value of x. -- 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