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,c08a7609345f4e5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!i13g2000yqd.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Limited use for limited with? Date: Wed, 29 Sep 2010 01:25:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: <517fb24e-8701-40ad-8c16-78e87c8a38dd@i13g2000yqd.googlegroups.com> References: <853314bc-0f79-435f-86a5-d7bcdd610731@c10g2000yqh.googlegroups.com> <36e886fa-b272-461f-bf86-a6b18366b64f@i5g2000yqe.googlegroups.com> <1eug9v5h5mf8d$.ud00hrz48lyr.dlg@40tude.net> <67044906-dacc-4526-b3f6-27e5323ab8fc@n3g2000yqb.googlegroups.com> <8762xpgk79.fsf@ludovic-brenta.org> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1285748729 25172 127.0.0.1 (29 Sep 2010 08:25:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Sep 2010 08:25:29 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i13g2000yqd.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14310 Date: 2010-09-29T01:25:29-07:00 List-Id: On 29 Wrz, 08:03, Ludovic Brenta wrote: > > Consider: > > > =A0 =A0procedure Register (X : in Object'Class); > > > X will be passed by reference, but there is still nothing in the > > signature (apart from the name of the operation) that would suggest > > that the reference will be leaked out of the operation's scope. So the > > user does this: > > > declare > > =A0 =A0X : My_Concrete_Object; > > begin > > =A0 =A0Register (X); > > endl; > > > and bang, everything breaks into pieces. > > No, because this is Ada :) [...] I was thinking about Register storing the access value somewhere, not copying the whole object. The whole idea of registering something is that state changes that are provoked by the registry are visible to the original creator of the object. Copying X by value makes no sense in this scenario, because object updates would not affect the original object. I want to logically register *my* object, not its copy. And of course there is still the possibility of Object to be limited (which is actually the case) - then no deep copy is possible. -- Maciej Sobczak * http://www.inspirel.com