comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Types, packages & objects : the good old naming conventions  question (without religious ware)
Date: Sat, 31 Oct 2009 14:36:25 +0100
Date: 2009-10-31T14:36:25+01:00	[thread overview]
Message-ID: <1dpvisl541g14$.1r4nl27ixks5q$.dlg@40tude.net> (raw)
In-Reply-To: 1a201412-454a-4994-af72-9e1e9840e248@p35g2000yqh.googlegroups.com

On Sat, 31 Oct 2009 05:38:32 -0700 (PDT), Hibou57 (Yannick Duchêne) wrote:

> On 31 oct, 12:47, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>> On Sat, 31 Oct 2009 04:30:38 -0700 (PDT), Hibou57 (Yannick Duchêne) wrote:
>>> On 31 oct, 10:49, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
>>> wrote:
>>>> "the cats"
>>> This is a class, not a type
>>> So let's call classes The_Xxxs (with an ending S)
>>> But what about types ? (and instances of a type)
>>
>> Class is a set of types. Type is a set of values. When the cat is an
>> object, the cats is its type. Mammals is the set of types that contain the
>> type cats. The corresponding type can be the mammals, i.e. flatten mammals
>> class.

> You are right, this is not a class.
> But the type may rather be seen as an abstraction of each individual
> instance (or as a representation of all the possible instances, thus
> the set, but not as a set of instances). The type, provide the way to
> create an instance, it may be used to create a set of value, but it is
> not a set of value (I know you use type right, I'm just trying to make
> terms clear).

Well, the set of all values of a type is equivalent to the type itself. It
would make little sense to distinguish them. That is formally. Practically
there is an aspect of constructiveness. We cannot enumerate all integers,
so we name them as Integer in order refer the set of, without constructing
it in the body. Any set of values is a type but it is incomputable to
decide of which type. In other words since structural equivalence does not
work we need type names. And even if the type T is "new Integer", indeed an
integer, we do not recognize that, and treat T and Integer distinct types.
That is another reason why we are short in type names.

> So let say now your « The Cats » is a type, and finally there is
> something which mark it, so this goes in the way of a mark to state a
> name is used a a type. “ The ” and the plural, may be seen as
> equivalent to the “ _Type ”

This is the instance-to-set way, but there is reverse approach:
set-to-instance. E.g. "of x", the possessive case "x's", the article "a x".
Natural languages are damn flexible.

Some people like:

   procedure Skin (Cat : A_Cat);

others do

   procedure Skin (A_Cat : Cat);

(:-))

I don't like either. Sometimes I do:

   procedure Skin (Victim : Cat);

Many do

   procedure Skin (Object : Cat);

Some natural languages apply cases to indicate objects:

   procedure Skin (Objet : Cat; Tool : Knife; Customer : Butcher);

(accusative, instrumental, dative cases). Interestingly that cases
represent some kind of types (roles) of objects.

>> In Ada there is no notation for the class. T'Class is a type, the closure
>> of the class rooted in T, i.e. all values of the members of types derived
>> from T.

> This do the job, isn't it ? And this is true that a type — which may
> be, at least potentially — the subject of any number of derivations,
> at least potentially stands for a class, even it is not actually
> derived. So there is no trouble to get the class rooted at a type from
> a type attribute. There is no need for an explicit declaration of a
> class, because the class associated to a tagged type, always exist,
> that's the concept, and does not need any declaration (the subtype is
> there, if a declaration is needed or wished).

No, it is rather because T in T'Class is decidable. But it is not
necessarily always so. Already with generics people run straight into
troubles passing T'Class for a plain formal type and wondering why no
dispatch happen. Again the question is how and if "member of" is
computable/obvious. Once types might become a more first-class citizens, or
the structure of classes more complicated T'Class might cease to work well.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2009-10-31 13:36 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-29 17:11 Types, packages & objects : the good old naming conventions question (without religious ware) Hibou57 (Yannick Duchêne)
2009-10-29 17:47 ` Dmitry A. Kazakov
2009-10-29 18:11 ` Georg Bauhaus
2009-10-29 22:41   ` tmoran
2009-10-30  0:01   ` Robert A Duff
2009-10-30  4:17     ` Georg Bauhaus
2009-10-30  4:52   ` Hibou57 (Yannick Duchêne)
2009-10-30  5:08     ` Jeffrey R. Carter
2009-10-30  5:28       ` Hibou57 (Yannick Duchêne)
2009-10-31 12:13       ` Stephen Leake
2009-10-30  8:14     ` tmoran
2009-10-31  6:35       ` Jacob Sparre Andersen
2009-11-01  8:24         ` Stephen Leake
2009-11-01 10:18           ` Peter C. Chapin
2009-11-01 13:01             ` Hibou57 (Yannick Duchêne)
2009-11-01 13:40               ` Hibou57 (Yannick Duchêne)
2009-11-05  0:33             ` Stephen Leake
2009-11-05  8:37               ` Dmitry A. Kazakov
2009-11-05  8:48                 ` Niklas Holsti
2009-11-05  9:13                   ` Dmitry A. Kazakov
2009-11-06  9:54                   ` Stephen Leake
2009-11-06 10:23                     ` Niklas Holsti
2009-11-06 10:24                     ` Dmitry A. Kazakov
2009-11-05 20:18               ` Vincent Marciante
2009-11-06 10:26                 ` Stephen Leake
2009-11-06 11:34                   ` Hibou57 (Yannick Duchêne)
2009-11-06 12:38                   ` Georg Bauhaus
2009-11-07  5:54                     ` Stephen Leake
2009-11-06 18:58                   ` Vincent Marciante
2009-11-07  5:57                     ` Stephen Leake
2009-11-09 18:25                       ` Vincent Marciante
2009-11-10  7:51                         ` Stephen Leake
2009-11-10 16:53                           ` Vincent Marciante
2009-12-29 23:27                             ` Hibou57 (Yannick Duchêne)
2009-12-30  9:31                               ` Georg Bauhaus
2009-12-30 14:13                                 ` Hibou57 (Yannick Duchêne)
2009-12-31 13:48                                 ` Marco
2010-01-09 15:03                                   ` Hibou57 (Yannick Duchêne)
2010-01-07 15:20                                 ` Hibou57 (Yannick Duchêne)
2010-01-07 15:42                                   ` Hibou57 (Yannick Duchêne)
2009-11-02  0:30           ` tmoran
2009-10-31 12:18       ` Stephen Leake
2009-10-30 10:52   ` Stephen Leake
2009-10-30 12:11     ` Hibou57 (Yannick Duchêne)
2009-10-30 13:40     ` Georg Bauhaus
2009-10-31 11:58       ` Stephen Leake
2009-11-02 20:36         ` Georg Bauhaus
2009-11-02 21:47         ` Randy Brukardt
2009-10-30 18:57     ` Jeffrey R. Carter
2009-10-31  1:45       ` Hibou57 (Yannick Duchêne)
2009-10-31  5:30         ` Hibou57 (Yannick Duchêne)
2009-10-31  5:44           ` Hibou57 (Yannick Duchêne)
2009-10-31  9:49           ` Dmitry A. Kazakov
2009-10-31 11:30             ` Hibou57 (Yannick Duchêne)
2009-10-31 11:47               ` Dmitry A. Kazakov
2009-10-31 12:38                 ` Hibou57 (Yannick Duchêne)
2009-10-31 13:36                   ` Dmitry A. Kazakov [this message]
2009-11-01  8:15           ` Stephen Leake
2009-10-31 12:11       ` Stephen Leake
2009-11-02 19:54         ` Georg Bauhaus
2009-11-05  0:39           ` Stephen Leake
2009-11-05 11:44             ` Georg Bauhaus
2009-11-06 10:14               ` Stephen Leake
2009-11-06 14:14                 ` Georg Bauhaus
2009-11-07  5:49                   ` Stephen Leake
2009-11-07 14:28                     ` Georg Bauhaus
2009-11-07 14:33                       ` Georg Bauhaus
2009-11-08  9:48                       ` Stephen Leake
2009-11-09 19:09                         ` Vincent Marciante
2009-11-10  7:58                           ` Stephen Leake
2009-10-29 18:33 ` Niklas Holsti
2009-10-29 19:35 ` Jeffrey R. Carter
2009-10-30  7:29   ` Niklas Holsti
2009-10-30 18:36     ` Jeffrey R. Carter
2009-10-30  9:24 ` dhenry
2009-10-30 10:01   ` Hibou57 (Yannick Duchêne)
2009-10-30 18:40   ` Jeffrey R. Carter
2009-10-31 12:25     ` Stephen Leake
2009-10-31 12:21   ` Stephen Leake
2009-10-31 13:08     ` Hibou57 (Yannick Duchêne)
2009-11-01  8:21       ` Stephen Leake
2009-10-30 10:48 ` Stephen Leake
2009-10-31  6:27   ` Splitting the object and type name spaces? (Was: Types, packages & objects : the good old naming conventions question (without religious ware)) Jacob Sparre Andersen
2009-10-31  7:16     ` Hibou57 (Yannick Duchêne)
2009-10-31  7:21       ` Hibou57 (Yannick Duchêne)
2009-10-31  9:58     ` Dmitry A. Kazakov
2009-11-02 22:05   ` Types, packages & objects : the good old naming conventions question (without religious ware) Randy Brukardt
2009-11-04 15:44     ` Hibou57 (Yannick Duchêne)
  -- strict thread matches above, loose matches on Subject: below --
2009-10-29 17:48 Britt Snodgrass
2009-10-30 10:56 ` Stephen Leake
2009-10-31 12:26   ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox