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=ham 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, 27 Aug 2025 09:39:59 +0200 Organization: A noiseless patient Spider Message-ID: <108mcoe$gv59$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> <10855lq$gj8l$1@dont-email.me> <1088h1a$19635$1@dont-email.me> <1089p1i$1ig1d$1@dont-email.me> <108aq2p$1qo9o$1@dont-email.me> <108dh2l$2f5h3$1@dont-email.me> <108ej11$2mbr8$1@dont-email.me> <108g1fv$32gqg$3@dont-email.me> <108h6b7$3a75k$3@dont-email.me> <87plcjn5ru.fsf@nightsong.com> <108hek3$3c6u1$1@dont-email.me> <87ldn7mil5.fsf@nightsong.com> <108ift9$3kh0r$1@dont-email.me> <108ijl2$3lihe$5@dont-email.me> <108jphl$3ti12$1@dont-email.me> <108liii$br9n$3@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 27 Aug 2025 07:39:59 +0000 (UTC) Injection-Info: dont-email.me; posting-host="27f675d80bb91bc8ee173b07c37e13d3"; logging-data="556201"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WuChD+FmMx11KAYtyegM9cF/v7PUqMWc=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:tNQwr/y+RrtJ5nEk+BzJHm834PY= In-Reply-To: <108liii$br9n$3@dont-email.me> Content-Language: en-US Xref: feeder.eternal-september.org comp.lang.ada:66937 List-Id: On 2025-08-27 02:13, Lawrence D’Oliveiro wrote: > On Tue, 26 Aug 2025 09:59:48 +0200, Dmitry A. Kazakov wrote: > >> On 2025-08-25 23:13, Lawrence D’Oliveiro wrote: >>> >>> On Mon, 25 Aug 2025 22:09:14 +0200, Dmitry A. Kazakov wrote: >>> >>>> The question remains why should I need to instantiate it beyond >>>> declaring an object of? >>> >>> Because in Python a class, like all objects, is created at runtime, not >>> compile time. Not true, because in Python there exist types created before the interpreter starts. But it is irrelevant. In Ada types can be created dynamically: declare type T is ... begin ... end; The difference is that the semantics of such types is static in Ada and undefined in Python. > No. In Ada, C or C++, definitions are not “executable”. They do not > “create objects”. Of course they are executable. They may or may not produce objects. > Think of a function that is a class factory: each time it is called, it > creates and returns a new class as the function result. This depends > crucially on a) classes as first-class objects, and also b) lexical > binding. > > Can you do that in Ada, C or C++? No you cannot. Yes I can. It is actively used in software design. E.g. for plug-ins, library implementing a driver derives a type from the base type. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de