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 21:33:43 +0200 Organization: cbb software GmbH Message-ID: <8mpcozm7olv1$.1x58obgxchzn8.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> <1x5zmf4ahhn24.1c5jwrp8hu2nb.dlg@40tude.net> <183ae4db-4005-4a2e-8ac7-82e51939b73d@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:26441 Date: 2015-06-23T21:33:43+02:00 List-Id: On Tue, 23 Jun 2015 12:14:44 -0700 (PDT), vincent.diemunsch@gmail.com wrote: > Le mardi 23 juin 2015 19:15:36 UTC+2, Dmitry A. Kazakov a écrit : > >> On Tue, 23 Jun 2015 09:57:43 -0700 (PDT), Vincent wrote: >>> 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. > > Ok ARM 2012 says : > Any set of types can be called a "category" of types, and any set of types > that is closed under derivation (see 3.4) can be called a "class" of > types. RM 83 calls it class of types (see 3.3). But that does not matter. I don't care about wording RM uses, meanings is what I care. > But I was trying to imagine a new category : a "class type". It would be something between : > - a general access-to-class-wide type > - a controlled object with Initialize, Adjust and Finalize. > - a protected type for the syntax of primitive operations What for? Any type is a set of values and operations defined on them. T'Class is necessary because there must be a type which values are from the closure (union of all sets of values of types derived from T). OOPL's mixing T and T'Class are inconsistent because sets of values are different. These two cannot be same type. When you want to introduce a type just start with its values and its operations. >>>>> 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. > > Ok. I should have said, very often one need a constrained object, > and this requires an access value for polymorphic tagged objects. Why? How this is even related to constraints? Constraint is a property of a set of types when for each given constraint there is a type. Yes, Ada RM does not call it "class", but that is RM's problem. A constrained subtype is a type. The sets of all constrained subtypes is a class. The type with values having different constraints is class-wide. Just another method of having classes, nothing more. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de