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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Access parameters and accessibility Date: Wed, 17 Dec 2014 19:56:56 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls7.std.com 1418864217 27546 192.74.137.71 (18 Dec 2014 00:56:57 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 18 Dec 2014 00:56:57 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:hUUotxPgVeqRYAdM78xvff/PQrI= Xref: news.eternal-september.org comp.lang.ada:24090 Date: 2014-12-17T19:56:56-05:00 List-Id: "Randy Brukardt" writes: > Yup. With the exception of timers, all of the others stem directly from the > mistake of using an anonymous access for streams. And *that* stems from the > mistake of not allowing "in out" parameters for functions (as Input is a > function). Yes, and *that* stems from the unfortunate fact that 'out' parameters don't work like function results (for composites). > Ergo, in Ada 2012 you would write those as "in out Root_Stream_Type'Class". > And one should think of them as exactly that. (It's too late to fix this > mistake, sadly.) Yes. > In the case of Timer, (a) no one ever uses this feature, and (b) I have no > idea why this just isn't > > type Timer (T : Ada.Task_Identification.Task_Id) is tagged limited private; Because Task_Id is a private type, and unfortunately you can't have discriminants of private type in Ada. > But it if is actually used as an access type (with the access value being > copied somewhere), then you have trouble (with random Program_Errors and a > need to avoid passing local objects). It's possible in Ada 2012 to write a > precondition for this case, but of course that's not required (and surely is > not found in existing libraries), so the possibility doesn't help much. Not sure what you mean. Could you show an example of such a precondition? - Bob