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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,dbbbb21ed7f581b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Operation can be dispatching in only one type Date: Thu, 19 Nov 2009 14:39:14 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <025105f2-5571-400e-a66f-ef1c3dc9ef32@g27g2000yqn.googlegroups.com> <94e76749-c49c-45aa-b7dc-386da0d71c66@e4g2000prn.googlegroups.com> <1u0im1tdws15u.1n9v9rz7bu4t4$.dlg@40tude.net> <39kf90ha60px$.d7746cf5cx6h.dlg@40tude.net> <691d6892-bc5e-4d81-8025-c36556bf2593@13g2000prl.googlegroups.com> <1h9hilcg5i6il.12edpgu4szw1h.dlg@40tude.net> <1wtsriaxu0s4s$.ikwnnz5teukp$.dlg@40tude.net> <223c52f9-50b6-4ff8-bf73-ecb9523b50d9@h40g2000prf.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls6.std.com 1258659546 29742 192.74.137.71 (19 Nov 2009 19:39:06 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 19 Nov 2009 19:39:06 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:JCLK4jm0P89juyM9nGLDVyFoQTE= Xref: g2news1.google.com comp.lang.ada:8159 Date: 2009-11-19T14:39:14-05:00 List-Id: Adam Beneschan writes: > On Nov 18, 6:11�pm, Robert A Duff > wrote: > >> My objection to run-time accessibility checks is that you can't pin the >> blame on a particular line of code: >> >> � � procedure P (X : access T); >> >> P either stores the access value in a long-lived global data structure >> (in which case P(Local'Access) is a bad idea in clients) >> or P does not do that >> (in which case P(Local'Access) is just fine). >> The author of P knows which one is the case, >> but has no way (other than comments) to communicate this to >> the author of the client. >> I've never seen a case where P decides at run time which it is. > > Since I'm too lazy to look, I'm hoping you know this off the top of > your head: is there anything in the AI's about preconditions that > would allow something to be caught when P is called rather than later > in the body of P? I thought there were also some proposed attributes > that could test accessibility levels. Such things have been discussed. We're probably going to have preconditions, and I seem to recall discussing some way to query the necessary accessibility-level info. But I think perhaps the best solution is to use a named access type, or an 'in out' parameter, in most cases. Functions are going to allow 'in out' parameters (probably), so the need for access parameters is much diminished. - Bob