>"Vinzent 'Gadget' Hoefler" a �crit dans le message de news:bnntu1$13vcju$1@ID->175126.news.uni-berlin.de... >As you can see, the behaviour of the subtype is absolutely correct, >although it might not be intuitive. I mean, adding 1 raises a >constraint error while adding 2 (or even more, try it) doesn't. > >So what we get here is a modular type with range constraints. *That's* >interesting... :-) The key to understanding this behaviour is that an expression is computed in its base type (not the expected subtype), and then converted to the expected subtype (which can raise Constraint_Error). Therefore, Constraint_Error is raised if the final value of the expression is incompatible with the constraint, but not during intermediate computations. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr