From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Best use cases for OOP (resent quoted sorry)
Date: Fri, 29 Aug 2025 10:28:24 +0200 [thread overview]
Message-ID: <108rob8$1rkon$4@dont-email.me> (raw)
In-Reply-To: <108qdsu$1j3g1$1@dont-email.me>
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
next prev parent reply other threads:[~2025-08-29 8:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 14:40 Best use cases for OOP Kevin Chadwick
2025-08-28 14:45 ` Best use cases for OOP (resent quoted sorry) Kevin Chadwick
2025-08-28 15:12 ` Dmitry A. Kazakov
2025-08-28 18:28 ` Niklas Holsti
2025-08-28 20:23 ` Alex // nytpu
2025-08-29 8:28 ` Dmitry A. Kazakov [this message]
2025-08-29 9:14 ` Kevin Chadwick
2025-08-29 10:37 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox