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 X-Google-Thread: a07f3367d7,25d835bb9a4a003f X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.158.31.10.MISMATCH!newsfeed-0.progon.net!progon.net!uucp.gnuu.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Types, packages & objects : the good old naming conventions question (without religious ware) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4ae9dade$0$6551$9b4e6d93@newsspool4.arcor-online.net> <30ad5ea8-955e-45c0-ae94-c84927cdb2b8@d5g2000yqm.googlegroups.com> <1pldds3sao0zf$.1h9y0q8qmnks1$.dlg@40tude.net> <1a201412-454a-4994-af72-9e1e9840e248@p35g2000yqh.googlegroups.com> Date: Sat, 31 Oct 2009 14:36:25 +0100 Message-ID: <1dpvisl541g14$.1r4nl27ixks5q$.dlg@40tude.net> NNTP-Posting-Date: 31 Oct 2009 14:36:25 CET NNTP-Posting-Host: 5ef52ca5.newsspool3.arcor-online.net X-Trace: DXC=NSmKVlQ_V On Sat, 31 Oct 2009 05:38:32 -0700 (PDT), Hibou57 (Yannick Duchêne) wrote: > On 31 oct, 12:47, "Dmitry A. Kazakov" > wrote: >> On Sat, 31 Oct 2009 04:30:38 -0700 (PDT), Hibou57 (Yannick Duchêne) wrote: >>> On 31 oct, 10:49, "Dmitry A. Kazakov" >>> 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