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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,26a21b9e317dc639 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.81.98 with SMTP id z2mr4232466pax.19.1353549555792; Wed, 21 Nov 2012 17:59:15 -0800 (PST) Received: by 10.50.154.132 with SMTP id vo4mr608587igb.7.1353549555753; Wed, 21 Nov 2012 17:59:15 -0800 (PST) Path: 6ni3225pbd.1!nntp.google.com!kt20no11074757pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 21 Nov 2012 17:59:15 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <114a6fcf-32c3-408f-961f-2e3bf3c5af04@googlegroups.com> <87af1bfd-41d2-45c7-953a-c1954d4f5ceb@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7f09e5c5-f118-4431-a3c2-4abd2145dc14@googlegroups.com> Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) From: Adam Beneschan Injection-Date: Thu, 22 Nov 2012 01:59:15 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-11-21T17:59:15-08:00 List-Id: On Wednesday, November 21, 2012 2:12:23 PM UTC-8, Randy Brukardt wrote: > "Adam Beneschan" wrote in message=20 > *IF* we made it legal, we'd simply change the convention to Ada. There is= no=20 > reason for the complication of a new kind of access type, because creatin= g a=20 > wrapper is simple. Moreover, both Ada 2005 and Ada 2012 require creating= =20 > wrappers in certain circumstances, so it's not like this is something a= =20 > compiler never has done before.=20 Our compiler creates wrappers too. I think that for a nested type extensio= n, it has to create a wrapper for each inherited operation. But that's onl= y done once per operation per type. I'm not thrilled with the idea of poss= ibly generating a wrapper every time an 'Access occurs, which is what I thi= nk would be needed. On the other hand, maybe in practice it wouldn't be a = problem. Maybe there wouldn't be that many occurrences of Obj.Operation'Ac= cess. Anyway, it sounds like a space/time tradeoff. It occurs to me that if you're right, we didn't need "access protected proc= edure/function" either, since that could also be implemented with wrappers,= I think (there's a difference in that a dereference that calls a protected= subprogram is a protected action, but I think the logic needed to make it = a protected action could probably be stuck inside the wrapper.) Anyway, it's all academic unless we actually decide it's worthwhile to make= this change, and I'm not sure it is. This was all pretty much musing abou= t how it *might* work. -- Adam