comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: I am not understanding user defined exceptions
Date: Sat, 4 Feb 2017 07:58:43 +0100
Date: 2017-02-04T07:58:43+01:00	[thread overview]
Message-ID: <o73tvs$je$1@dont-email.me> (raw)
In-Reply-To: <k3ba9chta4hqdcv4q6npmrdbffsnfeoi8l@4ax.com>

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


  reply	other threads:[~2017-02-04  6:58 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 20:27 I am not understanding user defined exceptions patrick
2017-02-03 21:08 ` Randy Brukardt
2017-02-03 22:41   ` patrick
2017-02-04  1:26 ` Dennis Lee Bieber
2017-02-04  6:58   ` J-P. Rosen [this message]
2017-02-04 17:08     ` Simon Wright
2017-02-08 17:55       ` Georg Bauhaus
2017-02-08 23:37         ` Randy Brukardt
2017-02-09 19:08           ` Robert A Duff
2017-02-09 21:47             ` Randy Brukardt
2017-02-09 22:52               ` Robert A Duff
2017-02-10  9:52                 ` Simon Wright
2017-02-10 10:11                   ` Dmitry A. Kazakov
2017-02-10 20:56                 ` Randy Brukardt
2017-02-10 21:09                 ` Randy Brukardt
2017-02-10 22:07                   ` Dmitry A. Kazakov
2017-02-13 23:20                     ` Randy Brukardt
2017-02-14  8:39                       ` Dmitry A. Kazakov
2017-02-14 20:07                         ` Randy Brukardt
2017-02-15  9:32                           ` Dmitry A. Kazakov
2017-02-10 23:53                   ` Shark8
2017-02-09  0:36         ` Robert A Duff
2017-02-09  7:43           ` Simon Wright
2017-02-09 19:15             ` Robert A Duff
2017-02-09 20:39               ` Randy Brukardt
2017-02-09 21:06               ` Randy Brukardt
2017-02-09 23:08                 ` Robert A Duff
2017-02-04  8:41 ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox