comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Depending on passing mechanism
Date: 1997/10/20
Date: 1997-10-20T00:00:00+00:00	[thread overview]
Message-ID: <EIDD1y.8Lz.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: hbaker-2010970513390001@10.0.2.1


Henry Baker (hbaker@netcom.com) wrote:

: ...
: This points up a 'meta' level problem with Ada83, which wasn't really fixed
: in Ada95: Ada separated the issues of parameter-passing 'modes' from
: 'types'.  Unfortunately, the author of a private/limited type wants to
: control the way it is passed and returned, and allowing the user of the
: type to make this choice is asking for trouble.  I seem to recall one of
: Tucker Taft's early proposals in which a solution to this problem was
: attempted.  Apparently, this proposal got soundly blasted, and it sank
: without much of a trace.  Pity.

As others have pointed out, in Ada 95 you *do* have control when
implementing a type to either force by-reference (by making the
underlying type tagged, protected, task, or limited record), to 
force by-copy (by making the underlying type elementary), or to indicate 
you "don't care" by using some other kind of type.  This seems to provide 
all the control you need to solve the problems Henry identified in his
paper on stealing from limited types that (might) use by-copy.  

The other kind of stealing is associated with unsynchronized simultaneous 
access, and in that case, by making the underlying type "protected,"
you get both exclusive access and by-reference parameter passing.

I don't think Ada 95 has a problem in this area any more.
The implementor of a type has full control.

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  reply	other threads:[~1997-10-20  0:00 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-13  0:00 Depending on passing mechanism Andre Spiegel
1997-10-13  0:00 ` Matthew Heaney
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00   ` Henry Baker
1997-10-15  0:00     ` JP Thornley
1997-10-15  0:00     ` Geert Bosch
1997-10-15  0:00       ` Robert Dewar
1997-10-15  0:00         ` Robert Dewar
1997-10-17  0:00           ` Andre Spiegel
1997-10-17  0:00             ` Henry Baker
1997-10-17  0:00               ` Jon S Anthony
1997-10-17  0:00               ` Robert I. Eachus
1997-10-21  0:00               ` Robert A Duff
1997-10-21  0:00                 ` Peter Hermann
1997-10-22  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Brian Rogoff
1997-10-22  0:00                 ` Henry Baker
1997-10-21  0:00                   ` Robert Dewar
1997-10-22  0:00                   ` Jon S Anthony
1997-10-22  0:00                   ` Brian Rogoff
1997-10-15  0:00         ` Brian Rogoff
1997-10-19  0:00           ` Robert Dewar
1997-10-22  0:00             ` Henry Baker
1997-10-15  0:00       ` Henry Baker
1997-10-15  0:00         ` Jon S Anthony
1997-10-15  0:00         ` Robert Dewar
1997-10-16  0:00         ` Brian Rogoff
1997-10-17  0:00           ` Henry Baker
1997-10-18  0:00             ` Brian Rogoff
1997-10-18  0:00               ` Matthew Heaney
1997-10-19  0:00                 ` Brian Rogoff
1997-10-21  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Robert Dewar
1997-10-22  0:00                       ` Brian Rogoff
     [not found]                         ` <dewar.877601826@merv>
1997-10-23  0:00                           ` Brian Rogoff
1997-10-23  0:00                       ` Henry Baker
1997-10-23  0:00                     ` Brian Rogoff
1997-10-19  0:00               ` Fergus Henderson
1997-10-19  0:00                 ` Brian Rogoff
1997-10-20  0:00                   ` Fergus Henderson
1997-10-20  0:00                 ` Henry Baker
1997-10-20  0:00                   ` Tucker Taft [this message]
1997-10-21  0:00                     ` Geert Bosch
1997-10-18  0:00             ` Fergus Henderson
1997-10-21  0:00     ` Robert A Duff
1997-10-22  0:00       ` Henry Baker
1997-10-21  0:00         ` Matthew Heaney
1997-10-22  0:00           ` Simon Wright
1997-10-23  0:00           ` Henry Baker
1997-10-23  0:00             ` Pat Rogers
1997-10-24  0:00             ` Robert Dewar
1997-10-23  0:00         ` Robert A Duff
1997-10-21  0:00   ` Keith Thompson
replies disabled

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