From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on ip-172-31-91-241.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=none autolearn=unavailable autolearn_force=no version=4.0.1 Path: nntp.eternal-september.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: In precision typing we trust Date: Wed, 20 Aug 2025 16:58:30 +0200 Organization: A noiseless patient Spider Message-ID: <1084nqo$co4e$1@dont-email.me> References: <107uv9g$3019a$1@dont-email.me> <107v1ji$303of$1@dont-email.me> <336fbb5f-a279-ea8e-67fd-f62bb00d6a89@irrt.De> <107vfb9$34cpj$1@dont-email.me> <10815an$3iu6o$1@dont-email.me> <10835ik$1m96$5@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 20 Aug 2025 14:58:32 +0000 (UTC) Injection-Info: dont-email.me; posting-host="7f25f95e58b51dba18d76f02adbe45f7"; logging-data="417934"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18klrzbnbZMfVxc4Q6UGkBcIpHsiYlbqY8=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:S4gacRGVgpyraiITxpoQWWL6NRk= Content-Language: en-US In-Reply-To: Xref: feeder.eternal-september.org comp.lang.ada:66886 List-Id: On 2025-08-20 15:59, Niocláisín Cóilín de Ghlostéir wrote: > On Wed, 20 Aug 2025, so became written: > |-----------------------------------------------------------------------| > |"On Tue, 19 Aug 2025 08:24:23 +0200, J-P. Rosen wrote:                 | > |                                                                       | > |> OOP implies a weakening of the typing system, since a wider class can| > |> contain any object of the subclass.                                  | > |                                                                       | > |Or conversely, a strengthening, since operations defined only on a     | > |subclass will not work on the superclass."                             | > |-----------------------------------------------------------------------| > > Operations defined only on a subclass would result in a superclass (or > any unrelated class) receivng a message which does not match its > protocol so it would crash. That is OOP. We do not need that. That is > not Ada. We need Ada. Class is a set of types. Subclass is a subset of types. In Ada's OO a subclass is a set of types derived from some type: S <: T Then S'Class is a subclass of T'Class. E.g. type T is tagged ...; type S is new T with ...; -- S'Class is a subclass of T'Class In no way an operation declared on S: procedure F (X : in out S); can be called on T. Ada is type safe. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de