comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Object-Oriented style question
Date: Mon, 9 Jan 2012 00:55:33 -0800 (PST)
Date: 2012-01-09T00:55:33-08:00	[thread overview]
Message-ID: <11047e9f-a7ef-4728-8e1c-4202c5958e9c@ck5g2000vbb.googlegroups.com> (raw)
In-Reply-To: 4f098fcb$0$6577$9b4e6d93@newsspool3.arcor-online.net

On Jan 8, 1:45 pm, Georg Bauhaus <rm-host.bauh...@maps.futureapps.de>
wrote:

>     function Info (Item : in T) return Value;
>     function Info_1 (Item_Doubly_Indirect : access T) return Value;
>     function Info_2 (Item_Doubly_Indirect : access constant T) return Value;
>     function Info_3 (Item_Doubly_Indirect : not null access constant T) return Value;

> I am thinking that the operations
> Info and Info_3 are almost the same,

Almost. And considering the fact that T is tagged and is passed by
reference, you might argue that their meaning is the same.

But I think that in one particular case you might want to distinguish
between these profiles - access value is a "name" of the object, not
the object itself, and therefore can be used for more involved lookup.
Like in a dictionary, where access values are lightweight keys.
Then, the real meaning of Info_3 would be "tell me what you know about
the object whose name is this-or-that", using perhaps multiple
dictionaries (or should I say "caches"?) or complicating this idea in
any other way you like.

In short: access value is a "name" of the object and therefore Info
and Info_3 do not have to mean the same.

I agree, however, that in most cases your original Info is the most
obvious and easy to decipher. At the didactic level this is what
should be used for teaching OO.

--
Maciej Sobczak * http://www.inspirel.com



  parent reply	other threads:[~2012-01-09  8:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-08 12:45 Object-Oriented style question Georg Bauhaus
2012-01-08 12:52 ` Simon Wright
2012-01-08 13:25   ` Dmitry A. Kazakov
2012-01-08 14:18 ` Robert A Duff
2012-01-08 20:32   ` Martin Dowie
2012-01-08 20:52     ` Robert A Duff
2012-01-09 22:34   ` Adam Beneschan
2012-01-09 23:21     ` Robert A Duff
2012-01-10  8:34     ` Dmitry A. Kazakov
2012-01-09  8:55 ` Maciej Sobczak [this message]
2012-01-09 23:58   ` Georg Bauhaus
2012-01-10  8:47     ` Maciej Sobczak
2012-01-10 10:27       ` Dmitry A. Kazakov
2012-01-10 12:27       ` Georg Bauhaus
2012-01-11  8:54         ` Maciej Sobczak
2012-01-10 21:26       ` Randy Brukardt
2012-02-08 12:23 ` Yannick Duchêne (Hibou57)
2012-02-08 12:39 ` Yannick Duchêne (Hibou57)
replies disabled

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