comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Subverting 'Access for Sub-programs
Date: 1999/08/05
Date: 1999-08-05T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.4.10.9908052144260.14625-100000@shell5.ba.best.com> (raw)
In-Reply-To: wcczp06jj39.fsf@world.std.com

On Thu, 5 Aug 1999, Robert A Duff wrote:
> "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr> writes:
> 
> > OK, I understand your problem better (full examples always help :-)
> > Of course, you realize that "Integrator" could store the pointer to function
> > to any global variable, possibly resulting later in random branches.
> 
> This is not true of either of the proposals the design team proposed.

That is true, and in the example I posted I used 'Unrestricted_Access is
the most portable solution. Your limited access to subprogram would have
worked fine, or even just Pascal style subprogram arguments (meaning, why 
confuse access types and subprogram types?).  

Your proposal to allow tagged limited types to be extended in nested
scopes was also pretty cool, though I'd like something like that in
addition to downward funargs. But downward funargs alone are way
useful; given the ability to use downward funargs safely I'd be more
likely to use funargs to parameterize the behavior of a primitive
subprogram of a tagged type than a nested extension.
 
> Your comment is, of course, true of 'Unchecked_Access on subprograms,
> but please note that the design team never wanted to allow that.  We
> believed that "call backs" and "downward closures" are two separate
> features, that each need their own (different) set of restrictions to be
> safe.  Call backs can't point to local subprograms, but they can be
> copied anywhere you like.  Downward closures can point to local
> subprograms, but they can't be copied into global places.  The language
> ended up with call backs, but not downward closures.
>
> Your comment is, of course, also true of what we ended up with --
> 'Unrestricted_Access, which is neither safe nor portable -- it's even
> less checked than 'Unchecked_Access.  That's what I meant when I said
> "too bad..." in another posting.

I think that the use of the feature is justified. If people don't think
the omission of downward funargs is a flaw, it will never get fixed. 
Unrestricted_Access is a way to get the hint across. Modify GNAT to use 
your safe proposal and I'll switch :-)

It was probably the right choice at the time (1990-1995) to exclude
downward funargs, and Robert Dewar's statement about the pain some
implementor's would have suffered seems reasonable enough. It won't seem 
reasonable much longer though.

-- Brian






  parent reply	other threads:[~1999-08-05  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 ` Brian Rogoff
1999-08-03  0:00 ` Michael F. Yoder
1999-08-03  0:00 ` David C. Hoos, Sr.
1999-08-05  0:00   ` Robert A Duff
1999-08-03  0:00 ` Ted Dennison
1999-08-03  0:00 ` tmoran
1999-08-03  0:00 ` Steve Doiel
1999-08-04  0:00 ` Anton Gibbs
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         ` Aidan Skinner
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     ` 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           ` tmoran
1999-08-06  0:00             ` Robert A Duff
1999-08-05  0:00           ` Brian Rogoff [this message]
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                       ` Brian Rogoff
1999-08-13  0:00                     ` Robert Dewar
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
1999-08-14  0:00                         ` Robert Dewar
1999-08-16  0:00                           ` Dmitry A. Kazakov
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-05  0:00   ` Steve Quinlan
1999-08-04  0:00 ` Robert Dewar
1999-08-04  0:00   ` Robert A Duff
1999-08-04  0:00     ` Robert Dewar
replies disabled

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