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,fa22a73e140a6fd1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.74.201 with SMTP id w9mr10322929pbv.0.1326099333669; Mon, 09 Jan 2012 00:55:33 -0800 (PST) Path: lh20ni159320pbb.0!nntp.google.com!news1.google.com!postnews.google.com!ck5g2000vbb.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Object-Oriented style question Date: Mon, 9 Jan 2012 00:55:33 -0800 (PST) Organization: http://groups.google.com Message-ID: <11047e9f-a7ef-4728-8e1c-4202c5958e9c@ck5g2000vbb.googlegroups.com> References: <4f098fcb$0$6577$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 83.3.40.82 Mime-Version: 1.0 X-Trace: posting.google.com 1326099333 17104 127.0.0.1 (9 Jan 2012 08:55:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 9 Jan 2012 08:55:33 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: ck5g2000vbb.googlegroups.com; posting-host=83.3.40.82; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-01-09T00:55:33-08:00 List-Id: On Jan 8, 1:45=A0pm, Georg Bauhaus wrote: > =A0 =A0 function Info (Item : in T) return Value; > =A0 =A0 function Info_1 (Item_Doubly_Indirect : access T) return Value; > =A0 =A0 function Info_2 (Item_Doubly_Indirect : access constant T) return= Value; > =A0 =A0 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