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.180.101.2 with SMTP id fc2mr6552674wib.0.1354157024406; Wed, 28 Nov 2012 18:43:44 -0800 (PST) MIME-Version: 1.0 Path: ha8ni73672wib.1!nntp.google.com!proxad.net!feeder1-2.proxad.net!weretis.net!feeder4.news.weretis.net!news.on-luebeck.de!reality.xs3.de!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) Date: Wed, 28 Nov 2012 20:43:41 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <114a6fcf-32c3-408f-961f-2e3bf3c5af04@googlegroups.com> <87af1bfd-41d2-45c7-953a-c1954d4f5ceb@googlegroups.com> <7f09e5c5-f118-4431-a3c2-4abd2145dc14@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1354157023 31580 69.95.181.76 (29 Nov 2012 02:43:43 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 29 Nov 2012 02:43:43 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Date: 2012-11-28T20:43:41-06:00 List-Id: "Adam Beneschan" wrote in message news:7f09e5c5-f118-4431-a3c2-4abd2145dc14@googlegroups.com... On Wednesday, November 21, 2012 2:12:23 PM UTC-8, Randy Brukardt wrote: ... >It occurs to me that if you're right, we didn't need "access protected >procedure/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.) Right, there is no implementation need for access-to-protected. But there is a difference here: the semantics of a protected call is a bit different than the semantics of an unprotected call, and there are cases where you need to make that visible. So there is a semantic reason beyond the implementation reason for having them separate. In any case, it's certainly true that Ada 83 and Ada 95 tried to avoid requiring wrappers in any circumstances (and that may be why we have access-to-protected -- I don't remember any discussions on that), but Ada 2005 and especially Ada 2012 have given up on that and definitely require them in a lot of cases. So much of the reason for convention Intrinsic and the like is really OBE. But do note that there are some cases where even a wrapper can't bail you out. The reason you can't in general take 'Access of a subprogram in a generic body is because a shared implementation can't make that work, even if wrappers are used. (To take one example.) So we can't just get rid of most of those rules without some thought. And then it's questionable whether it would be worth the effort. Randy.