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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e55245590c829bef X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Mon, 01 Nov 2010 21:43:57 +0100 Organization: Ada @ Home Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> NNTP-Posting-Host: R3GxioSikq39nI4ipB4BLA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.63 (Win32) Xref: g2news2.google.com comp.lang.ada:16097 Date: 2010-11-01T21:43:57+01:00 List-Id: Le Mon, 01 Nov 2010 20:59:27 +0100, Shark8 a = = =C3=A9crit: > I'll quite agree that it is [mostly] a matter of preference/taste, but= > to my thinking having the "_Type" appended for the type declaration is= > a little bit of redundancy {which is not always bad, else why do you > carry a spare tire?}. The case of _Type is the most exposed one, while the more confusing one = in = the mean time, and that does not help. To be clearer, in two parts and a short conclusion. First there is a need due to the lack of a name-space for types. When on= e = choose a word, this word is typically the same for both type and instanc= e, = as there is nothing like a type and instance in the natural language, = where instead of types, there is are prototypes, a prototype which is = something else than a special instance (which may be an idealization and= = may not really exist). So a Book type is something which define a book, = = any book anonymously. When instances all refers to particular instances = of = a books, like Ichbia's book, Rosen's book, there is no trouble, as you m= ay = have instances like Ichbia_Book, Rosen_Book. Except these kind of = instances, will more stands for constants only. As typical instances of = a = Book type will be variables, they will be anonymous on their own (as-is)= . = So, the Book type, which defines a book anonymously and an instance of = that type, which is to be, by definition of what a type is, an instance = of = any book possibly defined by the Book type, will be as much anonymous, a= nd = will refer to the same things. Except if that anonymous instance has a = particular role, which would make it distinct (thus, not so much = anonymous), the only difference is : one is the definition the other is = = the instance. That is the sole difference, so it will have the same name= , = so there will be a name clash, so to mark the difference, we need = something, either for the type name or the instance name. Instance appea= rs = more frequently used than type, so that it is less obfuscating to add = _Type to type name, than to add The_, A_ or An_ to the instance names. Then, _Type marks what a basic type is : value semantic, not class-wide.= = So at first sight, this seems un-useful, providing we forget about the = above (because due to the above, solely, we need _Type). If there was = nothing else and no Reference Semantic and no Class Wide, then indeed, = _Type would be u-useful. But there are some! _Type, as it stands for the= = basic of a type, then makes more sense if one do not think about it = solely, but also think its peers, like _Class, _Abstract, _Accees, and = _Class_Access (I would like to have something in a single word meaning = _Class_Access, but never found one). You would indeed not have any need = to = name colors if there were only one colors, but as there are many colors,= = you actually need to name these. So there are two orthogonal reasons for _Type. The first is a kind of = workaround, and for the second one, its usefulness only appears when you= = look wide enough. This is the source of lacks of understanding, as well as the source of = incomplete justifications to say _Type is un-useful (you may be able to = = justification _Type is not good, as long as you forget about the things = = explained above, but this actually exist). -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens.