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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,29fe9a340e0d180d X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Depending on passing mechanism Date: 1997/10/20 Message-ID: #1/1 X-Deja-AN: 282052890 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1997-10-20T00:00:00+00:00 List-Id: 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