On Fri, 5 Apr 2013, Dmitry A. Kazakov wrote: > We are discussing deficiencies of Ada type system, unable to capture > relations between domain specific entities modeled as objects and types. Well, that is a broader discussion than the part I was in, that was about the need for some Universal_String type, but OK. > E.g. few built-in numeric types, which are supposed to fit everything and > expectedly fail, because predefined numbers have properties you might not > need and miss ones you do need. The Op's subtype Prim was a perfect example > of such a failure. Prime numbers are neither additive nor multiplicative. > It is not a group. Yet Prime inherited the interface of a group from base > type (Positive) and there is no way to prohibit this. It also inherited the > order of Positives ('Succ), which is not one of Prime, and, again, there is > no language means for fix that. Here, I have agree with you. I understand that for historical reasons Prime'Succ is actually Prime'Base'Succ, and the designers of Ada 2012 have unable to get rid of that without introducing too many incompatibilities. But Prime'Succ(5)=4 is a big OUCH! I hope that Ada 2020 (or whatever) will prohibit the attibutes Succ and Pred for all subtypes with dynamic predicates! (I think, First and Last are prohibited anyway.) ------ I love the taste of Cryptanalysis in the morning! ------ --Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany--