comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de>
Subject: Re: Beginners question: Compound types, how-to?
Date: Wed, 03 Nov 2010 23:32:13 +0100
Date: 2010-11-03T23:32:12+01:00	[thread overview]
Message-ID: <4cd1e2ec$0$6978$9b4e6d93@newsspool4.arcor-online.net> (raw)
In-Reply-To: <Xns9E25A942893A1WarrensBlatherings@81.169.183.62>

On 11/3/10 9:38 PM, Warren wrote:
> Georg Bauhaus expounded in
> news:4cd19583$0$6977$9b4e6d93@newsspool4.arcor-online.net:
>
>> On 03.11.10 17:56, Warren wrote:
>>
>>> There is a good practical case for _Type, IMO. If Buffer_Type is
>>> defined simply as Buffer, then we develop an inconvenient name clash:
>>>
>>>>      subtype Buffer is
>>>>         System.Storage_Elements.Storage_Array (1..Buffer_Size);
>>>
>>> In use now:
>>>
>>> declare
>>>     Buffer : Buffer;   -- hmmmm
>>> begin
>>
>> What role does the object named Buffer play?
>>
>> It is a buffer, yes. Is it different from other buffers?
>> How?  What lives in it?  How does the program use it?
>>
>> I believe answering these questions leads to a better name.
>
> Ok, so the type is a Storage_Buffer. So is the instance
> of the type.

Actually, the type is not a Storage_Buffer.  The type has no
"is a" relation to Storage_Buffer, the type defines what
instances of Storage_Buffers are going to be like. Each object
"is a"  Storage_Buffer. A type is not.   OK, that's nitpicking.

A child born is of type Child.  A son is of type Son.  Sometimes
fathers address the Child: "Son, ...!"  But the son still
has a name.  If you have another son, maybe younger, you
know how to tell them apart.  And if there are two or more
around, "Son, ...!" may not work as intended.So they've got
names, to resolve the issue.  Suppose there
is just one.  Should computer programming therefore dismiss
assigning single sons a name and just name them "Son"?

In natural language, "Son, ..." may be a special form
of address.  Something out of the ordinary.  This meaning
is not covered by the *type* Son.  Maybe our overloading
of meanings of Son lets us think we might use the same naming
scheme in formal programming, if *we* know there is one
particular Son object around and we write the statements
addressing it.  Doesn't seem like a good idea to me to carry
this over to formal programming.

The Romans just counted sons, Primus, ..., Quintus, say.
Every son "is a" Son, but none of them were without identity
and none was *named* son!   Just *called*, at times, and
in special situations where ambiguity is resolved by human
means, not by a compiler.

Therefore, then, do we do ourselves a favor if we use  this
style of anonymity by duplicating the type name for objects?
For example, "Tu quoque, fili?" can be clarified in programming
by just injecting the name Brute, for an object of type Son.
As in

package body Caesar

  procedure Last_Words is
  begin
     Say ("To quoque, Brute, fili mi?")
  end Last_Words;

end Caesar;

I guess that for insiders, the phrase might not be catchy enough.
Too long. But for a more formal analysis, the specific object is nicely
spelled out (Brute), and the relation is clear, too (mi): Brutus,
that's the son's name, is Caesar's son (fili mi), not just someone's
son (fili) as a computer could infer, absent a possessive pronoun.

Suppose the string had just been "To quoque, fili", without Brute and
without mi.  The program's author sure had known better.

He had known the name but decided not to give it.
Why not?


> 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.




  parent reply	other threads:[~2010-11-03 22:32 UTC|newest]

Thread overview: 190+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31 22:00 Beginners question: Compound types, how-to? Mart van de Wege
2010-10-31 22:36 ` Vinzent Hoefler
2010-10-31 23:27   ` Yannick Duchêne (Hibou57)
2010-11-01  7:14     ` Mart van de Wege
2010-11-01 19:22       ` Jeffrey Carter
2010-11-02  9:38     ` J-P. Rosen
2010-11-01  3:55 ` Jeffrey Carter
2010-11-01  7:12   ` Mart van de Wege
2010-11-01 15:04     ` Shark8
2010-11-01 17:06       ` Mart van de Wege
2010-11-01 17:39         ` Yannick Duchêne (Hibou57)
2010-11-01 17:58           ` Mart van de Wege
2010-11-01 19:19         ` Jeffrey Carter
2010-11-01 19:41           ` Yannick Duchêne (Hibou57)
2010-11-01 20:56             ` Jeffrey Carter
2010-11-01 21:05               ` Yannick Duchêne (Hibou57)
2010-11-03 16:56             ` Warren
2010-11-03 17:01               ` Georg Bauhaus
2010-11-03 17:42                 ` Vinzent Hoefler
2010-11-04  5:23                   ` Stephen Leake
2010-11-04  9:41                     ` Georg Bauhaus
2010-11-06 16:49                       ` Stephen Leake
2010-11-06 18:43                         ` Jeffrey Carter
2010-11-06 19:35                         ` Georg Bauhaus
2010-11-12 20:17                       ` Randy Brukardt
2010-11-12 21:25                         ` Jeffrey Carter
2010-11-04 10:09                     ` Georg Bauhaus
2010-11-06 16:53                       ` Stephen Leake
2010-11-06 19:24                         ` Georg Bauhaus
2010-11-04 17:46                     ` Jeffrey Carter
2010-11-03 20:38                 ` Warren
2010-11-03 20:50                   ` Yannick Duchêne (Hibou57)
2010-11-03 22:32                   ` Georg Bauhaus [this message]
2010-11-04 13:59                     ` Warren
2010-11-04 20:57                       ` Martin
2010-11-05 20:43                         ` Warren
2010-11-03 20:44                 ` Yannick Duchêne (Hibou57)
2010-11-03 20:45                   ` Yannick Duchêne (Hibou57)
2010-11-03 21:27                   ` Simon Wright
2010-11-03 22:44                   ` Georg Bauhaus
2010-11-04  1:19                     ` Yannick Duchêne (Hibou57)
2010-11-04  5:18                       ` Shark8
2010-11-04  6:30                         ` Yannick Duchêne (Hibou57)
2010-11-04 14:23                           ` Warren
2010-11-04 10:29                       ` Georg Bauhaus
2010-11-04 11:06                         ` Yannick Duchêne (Hibou57)
2010-11-04 12:56                           ` Georg Bauhaus
2010-11-01 19:59           ` Shark8
2010-11-01 20:43             ` Yannick Duchêne (Hibou57)
2010-11-01 21:54               ` Shark8
2010-11-01 21:01             ` Jeffrey Carter
2010-11-01 21:49               ` Shark8
2010-11-02  0:07           ` Adam Beneschan
2010-11-02  8:17           ` Stephen Leake
2010-11-02  8:29             ` Yannick Duchêne (Hibou57)
2010-11-02  8:50               ` Dmitry A. Kazakov
2010-11-03 12:02               ` Searching for "_Type" discussions Stephen Leake
2010-11-02 19:02             ` Beginners question: Compound types, how-to? Jeffrey Carter
2010-11-02 19:22               ` Yannick Duchêne (Hibou57)
2010-11-02 20:24                 ` Simon Wright
2010-11-03 12:14                   ` _Type vs no _Type Stephen Leake
2010-11-03 21:16                     ` Yannick Duchêne (Hibou57)
2010-11-03 21:19                       ` Yannick Duchêne (Hibou57)
2010-11-04  5:37                         ` Stephen Leake
2010-11-04  5:29                       ` Stephen Leake
2010-11-03 21:29                     ` Simon Wright
2010-11-04  5:28                       ` Nasser M. Abbasi
2010-11-04  6:06                         ` Yannick Duchêne (Hibou57)
2010-11-04  6:40                         ` Shark8
2010-11-05 17:49                           ` Florian Weimer
2010-11-05 18:18                             ` Georg Bauhaus
2010-11-04 18:29                         ` Britt Snodgrass
2010-11-04 19:08                           ` Nasser M. Abbasi
2010-11-04 19:47                             ` Britt Snodgrass
2010-11-04 19:59                             ` Simon Wright
2010-11-04 22:38                               ` Yannick Duchêne (Hibou57)
2010-11-05  7:05                               ` Florian Weimer
2010-11-05  8:48                                 ` Yannick Duchêne (Hibou57)
2010-11-05 16:01                                   ` Dmitry A. Kazakov
2010-11-05 19:26                                     ` Jeffrey Carter
2010-11-05 19:34                                       ` Dmitry A. Kazakov
2010-11-05 19:35                                       ` Florian Weimer
2010-11-05 20:08                                         ` Dmitry A. Kazakov
2010-11-05 20:14                                           ` Florian Weimer
2010-11-05 21:01                                             ` Dmitry A. Kazakov
2010-11-05 20:45                                         ` Warren
2010-11-05 22:59                                           ` Brian Drummond
2010-11-09 20:29                                             ` Warren
2010-11-05 21:37                                         ` Jeffrey Carter
2010-11-05  3:10                             ` Georg Bauhaus
2010-11-05  6:54                             ` J-P. Rosen
2010-11-05 16:39                               ` Robert A Duff
2010-11-05 23:32                                 ` J-P. Rosen
2010-11-06  0:55                                   ` Yannick Duchêne (Hibou57)
2010-11-06 13:40                                     ` Simon Wright
2010-11-05 17:29                             ` Robert A Duff
2010-11-05 19:28                               ` Jeffrey Carter
2010-11-05 23:09                                 ` Robert A Duff
2010-11-06  0:44                                   ` Jeffrey Carter
2010-11-06 21:10                                     ` Robert A Duff
2010-11-07  0:01                                       ` Brian Drummond
2010-11-07 20:41                                       ` Jeffrey Carter
2010-11-07 21:03                                         ` Yannick Duchêne (Hibou57)
2010-11-05  6:49                           ` J-P. Rosen
2010-11-05  7:05                           ` Florian Weimer
2010-11-05  7:20                             ` J-P. Rosen
2010-11-05 17:39                               ` Florian Weimer
2010-11-05 18:08                                 ` Georg Bauhaus
2010-11-05 23:36                                 ` J-P. Rosen
2010-11-06  1:05                                 ` Yannick Duchêne (Hibou57)
2010-11-05 10:58                             ` Georg Bauhaus
2010-11-05 16:31                               ` Dmitry A. Kazakov
2010-11-05 17:38                                 ` Georg Bauhaus
2010-11-05 17:31                               ` Florian Weimer
2010-11-05 18:02                                 ` Georg Bauhaus
2010-11-05 23:29                               ` J-P. Rosen
2010-11-06  0:00                                 ` Robert A Duff
2010-11-06  0:12                                   ` Simon Wright
2010-11-06 11:34                                   ` J-P. Rosen
2010-11-06  0:01                                 ` Georg Bauhaus
2010-11-09 20:43                             ` Warren
2010-11-05 17:24                         ` Robert A Duff
2010-11-05 20:05                           ` Vinzent Hoefler
2010-11-05 22:28                             ` Robert A Duff
2010-11-04 17:40                     ` Jeffrey Carter
2010-11-05 17:15                       ` Robert A Duff
2010-11-05 19:24                         ` Jeffrey Carter
2010-11-05 22:52                           ` Robert A Duff
2010-11-06  0:40                             ` Jeffrey Carter
2010-11-06  7:12                               ` Dmitry A. Kazakov
2010-11-06 10:13                                 ` Yannick Duchêne (Hibou57)
2010-11-06 11:00                                 ` Georg Bauhaus
2010-11-06 11:35                                   ` Dmitry A. Kazakov
2010-11-06 13:34                                     ` Simon Wright
2010-11-06 14:53                                       ` Dmitry A. Kazakov
2010-11-06 20:52                                   ` Shark8
2010-11-06 21:58                                     ` Yannick Duchêne (Hibou57)
2010-11-07  2:57                                       ` Shark8
2010-11-07  3:12                                         ` Yannick Duchêne (Hibou57)
2010-11-07  6:37                                         ` J-P. Rosen
2010-11-06 17:10                                 ` (see below)
2010-11-06 22:08                                   ` Niklas Holsti
2010-11-06 22:24                                     ` Yannick Duchêne (Hibou57)
2010-11-06  0:42                             ` Shark8
2010-11-06 13:24                               ` Robert A Duff
2010-11-06 21:20                                 ` Shark8
2010-11-06 22:12                                   ` Yannick Duchêne (Hibou57)
2010-11-16 20:33                                     ` Randy Brukardt
2010-11-06  1:33                             ` Yannick Duchêne (Hibou57)
2010-11-04 17:49                     ` Jeffrey Carter
2010-11-02 20:38                 ` Beginners question: Compound types, how-to? Jeffrey Carter
2010-11-02 20:59               ` Britt Snodgrass
2010-11-03  0:46                 ` Georg Bauhaus
2010-11-03  1:59                   ` Yannick Duchêne (Hibou57)
2010-11-03 12:59                     ` Georg Bauhaus
2010-11-03 15:28                       ` Georg Bauhaus
2010-11-03  8:58                   ` Dmitry A. Kazakov
2010-11-03 12:31                     ` Georg Bauhaus
2010-11-03 12:18                   ` Stephen Leake
2010-11-03 13:12                     ` Georg Bauhaus
2010-11-04  0:55                     ` Yannick Duchêne (Hibou57)
2010-11-03 17:35                   ` Vinzent Hoefler
2010-11-03 21:19                     ` Simon Wright
2010-11-03 21:31                       ` Vinzent Hoefler
2010-11-04  5:25                         ` Stephen Leake
2010-11-04 17:47                           ` Jeffrey Carter
2010-11-04  6:11                         ` Yannick Duchêne (Hibou57)
2010-11-04 19:30                           ` Vinzent Hoefler
2010-11-04 17:42                         ` Jeffrey Carter
2010-11-03 12:06               ` Stephen Leake
2010-11-04  1:04                 ` Yannick Duchêne (Hibou57)
2010-11-04 17:11                 ` Jeffrey Carter
2010-11-04 13:47               ` Peter C. Chapin
2010-11-04 14:30                 ` Warren
2010-11-01 17:24     ` Yannick Duchêne (Hibou57)
2010-11-01 21:31       ` Simon Wright
2010-11-01 19:05     ` Jeffrey Carter
2010-11-01 11:50   ` (see below)
2010-11-01 17:16     ` Yannick Duchêne (Hibou57)
2010-11-01 17:27       ` Georg Bauhaus
2010-11-01 17:41         ` Yannick Duchêne (Hibou57)
2010-11-01 17:55           ` Yannick Duchêne (Hibou57)
2010-11-01 18:12       ` Adam Beneschan
2010-11-01 19:25     ` Jeffrey Carter
2010-11-01 12:03 ` Brian Drummond
2010-11-01 12:17   ` Florian Weimer
2010-11-01 13:05   ` Mart van de Wege
2010-11-01 22:45     ` Brian Drummond
2010-11-01 23:17       ` Yannick Duchêne (Hibou57)
2010-11-02  8:32         ` 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