comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <dmitry@gandalf.atm.fh-luebeck.de>
Subject: Re: Subverting 'Access for Sub-programs
Date: 1999/08/12
Date: 1999-08-12T13:50:04+00:00	[thread overview]
Message-ID: <37B2D220.9CAAD611@gandalf.atm.fh-luebeck.de> (raw)
In-Reply-To: 7osa8r$gdq$1@nnrp1.deja.com


Robert Dewar wrote:

> In article <37B18CF0.F50A802B@gandalf.atm.fh-luebeck.de>,
>   "Dmitry A. Kazakov" <dmitry@gandalf.atm.fh-luebeck.de> wrote:
> > I believe that the actual problem is in using pointers. In
> 90%, I would
> > say, there is
> > no need to pass a subroutine by pointer. It should be passed by
> > reference: What we
> > need is something like (syntax is imaginary):
>
> But passing subprograms as parameters is only one of many
> possible uses of subprogram pointers. Indeed it is one of
> the weakest uses, in that this particular use often can
> be replaced by generics. The motivation for providing
> pointers to subprograms during the Ada 95 design was
> driven by other uses entirely, most notably by the need
> for implementing call backs (and of course if you think
> about it the use of procedure pointers implicit in
> dynamic dispatching is also another kind of use completely
> unrelated to the call by reference notion).

I do not argue against subprogram pointers. But it is a bit strange
to provide them without variables which values they point to. (:-))

As for call backs there are different sorts of them.

1. When pointer to call back will be copied by the callee, then
yes, it must be passed by pointer. Further, in this case it is pretty
meaningful not to allow 'unchecked_access which result could be
catastrophic in some contexts.

2. Otherwise (when used locally) it should be passed by reference,
which would lift all unnecessary (in this case) limitations of 'access.
The same way you pass a variable.

Best regards,
Dmitry





  reply	other threads:[~1999-08-12  0:00 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-03  0:00 Subverting 'Access for Sub-programs Anton Gibbs
1999-08-03  0:00 ` Ted Dennison
1999-08-03  0:00 ` tmoran
1999-08-03  0:00 ` Steve Doiel
1999-08-03  0:00 ` Michael F. Yoder
1999-08-03  0:00 ` Brian Rogoff
1999-08-03  0:00 ` David C. Hoos, Sr.
1999-08-05  0:00   ` Robert A Duff
1999-08-04  0:00 ` Robert Dewar
1999-08-04  0:00   ` Robert A Duff
1999-08-04  0:00     ` Robert Dewar
1999-08-04  0:00 ` Anton Gibbs
1999-08-04  0:00   ` Jean-Pierre Rosen
1999-08-04  0:00     ` Brian Rogoff
1999-08-05  0:00       ` Jean-Pierre Rosen
1999-08-05  0:00         ` Robert A Duff
1999-08-05  0:00           ` Brian Rogoff
1999-08-06  0:00             ` Robert Dewar
1999-08-09  0:00               ` Tucker Taft
1999-08-10  0:00                 ` Robert Dewar
1999-08-11  0:00                   ` Tucker Taft
1999-08-13  0:00                     ` Robert Dewar
1999-08-13  0:00                     ` Robert Dewar
1999-08-13  0:00                       ` Brian Rogoff
1999-08-11  0:00                   ` Robert A Duff
1999-08-11  0:00                     ` Robert Dewar
1999-08-11  0:00                   ` Dmitry A. Kazakov
1999-08-11  0:00                     ` Richard D Riehle
1999-08-11  0:00                     ` Robert Dewar
1999-08-12  0:00                       ` Dmitry A. Kazakov [this message]
1999-08-14  0:00                         ` Robert Dewar
1999-08-16  0:00                           ` Dmitry A. Kazakov
1999-08-05  0:00           ` tmoran
1999-08-06  0:00             ` Robert A Duff
1999-08-05  0:00           ` Robert Dewar
1999-08-05  0:00         ` adam
1999-08-05  0:00           ` adam
1999-08-06  0:00             ` Robert A Duff
1999-08-06  0:00               ` adam
1999-08-09  0:00                 ` Robert A Duff
1999-08-09  0:00                 ` Mark Biggar
1999-08-05  0:00           ` Robert Dewar
1999-08-05  0:00             ` What is a Display ? (was: Subverting 'Access for Sub-programs) Larry Kilgallen
1999-08-05  0:00               ` Hyman Rosen
1999-08-06  0:00                 ` Robert Dewar
1999-08-06  0:00               ` Robert Dewar
1999-08-06  0:00         ` Subverting 'Access for Sub-programs Brian Rogoff
1999-08-07  0:00           ` Gautier
1999-08-05  0:00     ` Robert A Duff
1999-08-05  0:00       ` Robert Dewar
1999-08-05  0:00         ` Brian Rogoff
1999-08-04  0:00   ` Robert A Duff
1999-08-04  0:00     ` Brian Rogoff
1999-08-05  0:00       ` tmoran
1999-08-05  0:00         ` Robert Dewar
1999-08-05  0:00           ` Ray Blaak
1999-08-06  0:00             ` Jean-Pierre Rosen
1999-08-06  0:00               ` Hyman Rosen
1999-08-07  0:00                 ` Florian Weimer
1999-08-06  0:00             ` Robert Dewar
1999-08-06  0:00               ` Robert A Duff
1999-08-08  0:00                 ` Brian Rogoff
1999-08-09  0:00                   ` Robert A Duff
1999-08-10  0:00                     ` Brian Rogoff
1999-08-09  0:00                 ` Tucker Taft
1999-08-05  0:00         ` Aidan Skinner
1999-08-05  0:00     ` Anton Gibbs
1999-08-05  0:00   ` Steve Quinlan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox