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-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.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: Wed, 18 Nov 2009 21:11:04 -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> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1258596657 30246 192.74.137.71 (19 Nov 2009 02:10:57 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 19 Nov 2009 02:10:57 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:rCvuJG6QrgRphtMOVrJyYcNYd90= Xref: g2news1.google.com comp.lang.ada:8150 Date: 2009-11-18T21:11:04-05:00 List-Id: "Randy Brukardt" writes: > OTOH, doing something that even generates a runtime accessibility check is a > bug IMHO (it's what Bob Duff calls a "tripping hazard"... I didn't invent the term. ;-) I think I first heard it from OSHA regulations, when I was working in a factory making "real stuff" instead of software. For example, I just found this by googling "OSHA tripping hazard": Extension cords that could cause a tripping hazard. This is an easy area for OSHA to find violations while auditing most organizations. Extension cords are a major cause of tripping and fall hazards and therefore are under a microscope. Extension cords shall not be found passing through hallways, windows and other areas which could cause a tripping hazard. ... and train employees how to use the cords without creating a tripping hazard. 29 CFR 1910.310 & 1910.305(G)(2)(iii) >... - a latent problem > that will bite you when someone does something unconventional -- in that > sense it is just like the bug of assigning a string parameter has lower > bound 1); it would be useful if the compiler could optionally point out such > places so you could fix them. 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. So we have a run-time check on something that is known at compile time (by the person who wrote P), and should be known at compile time (by the person who wrote the client). Yes, it's a tripping hazard. And when the exception is raised, we don't know whether P or client-of-P is at fault. - Bob