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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: donh@syd.csa.com.au (Don Harrison) Subject: Re: OO, C++, and something much better! Date: 1997/01/24 Message-ID: #1/1 X-Deja-AN: 211885018 sender: news@syd.csa.com.au x-nntp-posting-host: dev50 references: <32E774C4.534B@watson.ibm.com> organization: CSC Australia, Sydney reply-to: donh@syd.csa.com.au newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-01-24T00:00:00+00:00 List-Id: Norman H. Cohen writes: :Don Harrison wrote: :> :> Matthew Heaney writes: :> :.... :> : :> :And as far as your example "proving" that Ada is not type-safe: that is :> :incorrect. :> :> Correct, according to the Ada definition. As Norman Cohen put it, :> :> : It shows that Ada is not subtype-safe. :> :> That becomes "not type-safe" if you regard sub-types as distinct types. : :I'm reminded of the following riddle, which I've seen attributed to :Abraham Lincoln: : : Q: If you call a dog's tail a leg, how many legs does a dog have? : A: Four. Calling the tail a leg does not make it one. Nice quote. :) If Abe Lincoln said it, it must be true! :) :Calling a subtype a distinct type does not make it one. Reread that :post of mine that you quoted. Its main point is that, according to the :Ada definition, subtypes are NOT distinct types. I no longer have it but I did read it. What you suggest is true "according to the Ada definition". However, IMO, the definition is inadequate. :Distinct types are :disjoint sets of values distinguished at compile time. Don't agree. I think they must simply be *different* sets of values. In the special case where the set of values is a subset of the values of another type, you have a sub-type (in the Ada sense). :Subtypes of a :type are (possibly overlapping) sets of values in the same type, :distinguished by whether or not they obey certain constraints that can, :in general, only be checked at run time. Yes ... "according to the Ada definition". The real issue, as far as I'm concerned, is that type safety (not surprisingly) depends on the definition a type. A language such as Eiffel might be regarded as type-unsafe purely because it regards sub-types as distinct types. These types - and their attendant runtime constraint violations - are materially no different from equivalent sub-types in Ada - which also cause runtime constraint violations. It's absolutely meaningless to declare one language type-safe and another unsafe without reference to the definition of type underlying the claim. Is it possible to write a system-invalid Ada program? Definitely, ... as you can with Eiffel. Don. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison donh@syd.csa.com.au