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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: Beginners question: Compound types, how-to? Date: Thu, 4 Nov 2010 13:59:17 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <86wroy58ff.fsf@gareth.avalon.lan> <86pqup5xfy.fsf@gareth.avalon.lan> <86y69d3rec.fsf@gareth.avalon.lan> <4cd19583$0$6977$9b4e6d93@newsspool4.arcor-online.net> <4cd1e2ec$0$6978$9b4e6d93@newsspool4.arcor-online.net> Injection-Date: Thu, 4 Nov 2010 13:59:17 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="12243"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ERznKzC6X826FjCR0ORt46JfAyQMyQl4=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:o35YixxAxsqQlINMfxaDyJcHzzM= Xref: g2news2.google.com comp.lang.ada:16187 Date: 2010-11-04T13:59:17+00:00 List-Id: Georg Bauhaus expounded in news:4cd1e2ec$0$6978$9b4e6d93 @newsspool4.arcor-online.net: .. >> Storage_Buffer : Storage_Buffer; >> >> doesn't get us any closer to solving the problem. ;-) >> >> Sometimes the number of instances is one -- matching the >> type. In cases like these you are still left with the >> task of making them different-- merely for the purpose >> making them different. > > I still think that not having a object name based on the object's > role, say, shows that you have not yet clearly named the purpose > of this object in the program. Sometimes that's enough. > I think, however, that quick and dirty anonymity characterizes > programs that need but a limited amount of engineering. Here is a real world example: I define a type Terminal to manage state for a curses mode terminal. It is _unlikely_ that I'll ever manage more than one terminal in this Basic interpreter, even though the curses API leaves that possibility open. A terminal doesn't have a name, like Henry (no offense to Henrys). Adding colour to the name like Blue_Terminal is in appropriate. There is only ever going to be _ONE_ instance of that type. So what names do you give the type and the single instance? Terminal : Terminal_Type; -- or The_Terminal : Terminal; If you say the type should be more specific like Curses_Terminal, then you could argue that the instance named Terminal is not a good enough name for the instance. This brings us full circle, back to: Curses_Terminal : Curses_Terminal; So in the end, you sometimes make a distinction, SOLELY for the sake of making them different. Instance vs Type. IDEALLY, the language would be context sensitive enough to allow you to use the same name in both contexts. Ada obviously is not designed that way and I'm not suggesting it be changed. It might even be a bad idea in the context of "safety". As others have said, this is simply a practical issue with various practical solutions. Religious practices and chicken bone waving sometimes applies. Warren