comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada design bug or GNAT bug?
Date: Tue, 23 Jun 2015 21:33:43 +0200
Date: 2015-06-23T21:33:43+02:00	[thread overview]
Message-ID: <8mpcozm7olv1$.1x58obgxchzn8.dlg@40tude.net> (raw)
In-Reply-To: 183ae4db-4005-4a2e-8ac7-82e51939b73d@googlegroups.com

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

  reply	other threads:[~2015-06-23 19:33 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20 18:55 Ada design bug or GNAT bug? Dmitry A. Kazakov
2015-06-21  2:42 ` Randy Brukardt
2015-06-21  6:47   ` Dmitry A. Kazakov
2015-06-22 17:39     ` Randy Brukardt
2015-06-22 18:16       ` Dmitry A. Kazakov
2015-06-23 11:00         ` G.B.
2015-06-23 14:27           ` Dmitry A. Kazakov
2015-06-23 11:45         ` G.B.
2015-06-23 14:30           ` Dmitry A. Kazakov
2015-07-02 22:22         ` Randy Brukardt
2015-07-03  8:02           ` Dmitry A. Kazakov
2015-07-03 17:33             ` Randy Brukardt
2015-07-03 21:34               ` Dmitry A. Kazakov
2015-07-04  3:11                 ` Randy Brukardt
2015-07-04 12:14                   ` Dmitry A. Kazakov
2015-07-05  0:53                     ` Randy Brukardt
2015-06-22 18:27       ` Shark8
2015-06-23 11:51         ` vincent.diemunsch
2015-06-23 19:55           ` Shark8
2015-06-23 13:06         ` vincent.diemunsch
2015-06-23 14:30           ` David Botton
2015-06-23 15:57             ` Niklas Holsti
2015-06-23 16:01               ` G.B.
2015-06-23 18:05               ` David Botton
2015-06-23 19:38               ` David Botton
2015-06-23 14:38           ` Dmitry A. Kazakov
2015-06-23 16:57             ` Vincent
2015-06-23 17:15               ` Dmitry A. Kazakov
2015-06-23 19:14                 ` vincent.diemunsch
2015-06-23 19:33                   ` Dmitry A. Kazakov [this message]
2015-06-23 17:42           ` Jeffrey R. Carter
2015-07-02 22:06           ` Randy Brukardt
2015-07-04  1:52             ` Shark8
2015-07-04  3:24               ` Randy Brukardt
2015-07-04 11:02                 ` Build-in-place semantics? (Was: Ada design bug or GNAT bug?) Jacob Sparre Andersen
2015-07-04 12:15                   ` Dmitry A. Kazakov
2015-07-05  0:45                     ` Randy Brukardt
2015-07-05  7:10                       ` Dmitry A. Kazakov
2015-07-05  0:40                   ` Randy Brukardt
2015-07-04 14:05                 ` Ada design bug or GNAT bug? Bob Duff
2015-07-04  7:46               ` Simon Wright
2015-07-04 12:00                 ` Björn Lundin
2015-07-05  0:48                   ` Randy Brukardt
2015-07-06 12:37             ` Vincent
2015-07-06 20:05               ` Randy Brukardt
2015-07-07  8:06               ` 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