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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada design bug or GNAT bug? Date: Tue, 23 Jun 2015 19:15:28 +0200 Organization: cbb software GmbH Message-ID: <1x5zmf4ahhn24.1c5jwrp8hu2nb.dlg@40tude.net> References: <4lrj5zz2u2z.u8x9cf7xzic6.dlg@40tude.net> <58f64fa9-7d0b-44dd-870c-77d9afcb82c4@googlegroups.com> <1f6dpcxmxly1a$.zfhetu1wgtix$.dlg@40tude.net> <667dce55-6a08-430b-bbe2-367e26a41e4e@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: evoS9sCOdnHjo0GRLLMU1Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:26436 Date: 2015-06-23T19:15:28+02:00 List-Id: On Tue, 23 Jun 2015 09:57:43 -0700 (PDT), Vincent wrote: > Le mardi 23 juin 2015 16:38:43 UTC+2, Dmitry A. Kazakov a écrit : > > > For the OOP concept is based on an interface that is the same and >>> instances that are different realizations of the same concept. >> >> This is an inconsistent concept if taken literally. OOP never talk about >> types being same. It does about same *behavior*. This is miles over miles >> different. T and T'Class behave as if they were same in some contexts, but >> they are not same from any point of view. Remember that class is a set of >> types. A set is never equal to its instances. T'Class is a closure of >> class. Closure of a set is not equal to an element of the set. > > A would rather call a set of types a category [of types], like Integers or > dicrete types. Integers is a class of types, so discrete types are. > A class type is an accessor to a category consisting of a given type and > all types derived from it. That is a parent type, which is just a type as any other. The set of types bound by some relation (e.g. inheritance) is a class. The class type as T'Class, is a type corresponding to the closure of the set using the relation. >>> One may think that the distinction between class type and tagged type is >>> subtle, but the implications of it are huge : without class object one >>> needs as replacement access to a class wide type. >> >> Why? > > Because one need a concrete object! tagged object is a concrete object. > With generics you can have a formal > type because it will be instantiated during the early phase of > compilation, but with OOP the code is generated before one knows the type > of the object that will be called at runtime. Ada supports shared generic bodies. For them code is generated before instantiation. > Strictly speaking this is not possible. I don't know what you mean. The difference between static and dynamic polymorphism is not when and how the code is being generated. > The only possible solution is to use a unique object as an > accessor for all possible objects. A solution for what? Why there should be common ancestor of a polymorphic class (set of types). There could be type systems when two types are mutual ancestors and descendants of each other. The inheritance graph is not necessarily a tree. > The simplest way was to use an access > to a class wide type. Access type is not an ancestor of target types. In a better Ada it could be descendant or a subtype, but not in present Ada. > But Ada 83 limited the use of access types to pool specific types... Ada 83 didn't mentioned pools. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de