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: Best use cases for OOP (resent quoted sorry) Date: Fri, 29 Aug 2025 10:28:24 +0200 Organization: A noiseless patient Spider Message-ID: <108rob8$1rkon$4@dont-email.me> References: <108pppp$1dmp6$1@dont-email.me> <108pq1l$1dp6u$1@dont-email.me> <108qdsu$1j3g1$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 29 Aug 2025 08:28:25 +0000 (UTC) Injection-Info: dont-email.me; posting-host="2875a737d4341ace9c98c50ea5ed6746"; logging-data="1954583"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/se6SFMOP6WrwJcuTiaYdxOEouZLChJRc=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:rdo4pNJ7mu9Mnhpz2zc83aPjeA8= In-Reply-To: <108qdsu$1j3g1$1@dont-email.me> Content-Language: en-US Xref: feeder.eternal-september.org comp.lang.ada:66989 List-Id: On 2025-08-28 22:23, Alex // nytpu wrote: > The only > real issue is that IIRC tagged types are always at least twenty bytes on > GNAT (on ARMv4T/ARMv5T at least, since developing for them is the only > time I've gotten warnings about this limitation) which precludes things > like having a record be small enough to be passed in a register instead > of the stack, but not much of an issue on modern systems. The reason is that tagged types are by-reference types. And that is because one wanted to have T'Class <-> T conversions a mere view conversions. One language extension I always wanted were an ability to have classes of types without having a tag embedded in the representation. So that one could have Boolean'Class. In this model T'Class <-> T would be a full conversion producing a new object. The types must be by-value then. Furthermore for such types re-dispatch would be impossible: procedure Foo (X : in out T) is begin T'Class (X).Bar; -- Error, T'Class (X) is a new object -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de