From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada)
Date: Wed, 28 Nov 2012 20:43:41 -0600
Date: 2012-11-28T20:43:41-06:00 [thread overview]
Message-ID: <k96i4v$uqs$1@munin.nbi.dk> (raw)
In-Reply-To: 7f09e5c5-f118-4431-a3c2-4abd2145dc14@googlegroups.com
"Adam Beneschan" <adam@irvine.com> 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.
next prev parent reply other threads:[~2012-11-29 2:43 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-19 9:59 Access type to member procedure of instance (Object Oriented programming in Ada) ake.ragnar.dahlgren
2012-11-19 11:13 ` Georg Bauhaus
2012-11-19 11:39 ` Brian Drummond
2012-11-20 11:43 ` Brian Drummond
2012-11-20 21:57 ` Randy Brukardt
2012-11-19 13:03 ` sbelmont700
2012-11-19 16:18 ` Adam Beneschan
2012-11-19 17:02 ` Peter C. Chapin
2012-11-19 18:23 ` Adam Beneschan
2012-11-19 20:57 ` Peter C. Chapin
2012-11-19 21:26 ` Dmitry A. Kazakov
2012-11-19 22:19 ` Adam Beneschan
2012-11-20 10:12 ` Dmitry A. Kazakov
2012-11-20 21:51 ` Randy Brukardt
2012-11-21 8:24 ` Dmitry A. Kazakov
2012-11-21 22:19 ` Randy Brukardt
2012-11-20 10:59 ` Brian Drummond
2012-11-19 20:22 ` ake.ragnar.dahlgren
2012-11-20 11:16 ` Brian Drummond
2012-11-19 20:52 ` ake.ragnar.dahlgren
2012-11-19 21:56 ` Dmitry A. Kazakov
2012-11-22 9:49 ` ake.ragnar.dahlgren
2012-11-19 22:13 ` sbelmont700
2012-11-19 23:59 ` Randy Brukardt
2012-11-20 0:05 ` Randy Brukardt
2012-11-20 1:00 ` Adam Beneschan
2012-11-20 21:38 ` Randy Brukardt
2012-11-20 23:43 ` Adam Beneschan
2012-11-21 22:12 ` Randy Brukardt
2012-11-22 1:59 ` Adam Beneschan
2012-11-29 2:43 ` Randy Brukardt [this message]
2012-11-20 0:52 ` Adam Beneschan
2012-11-20 21:34 ` Randy Brukardt
2012-11-20 11:28 ` Brian Drummond
2012-11-20 14:27 ` Georg Bauhaus
2012-11-20 15:52 ` Adam Beneschan
2012-11-22 9:47 ` ake.ragnar.dahlgren
2012-11-22 10:25 ` Dmitry A. Kazakov
2012-12-02 20:42 ` ake.ragnar.dahlgren
2012-12-03 11:21 ` Dmitry A. Kazakov
2012-12-03 20:21 ` ake.ragnar.dahlgren
2012-12-03 22:15 ` Dmitry A. Kazakov
2012-12-25 21:51 ` Gustaf Thorslund
2012-12-26 18:11 ` ake.ragnar.dahlgren
2012-11-22 12:13 ` Brian Drummond
2012-12-03 16:17 ` ake.ragnar.dahlgren
2012-12-03 21:56 ` Brian Drummond
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox