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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9697af769c7c74cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-04-02 10:11:32 PST Newsgroups: comp.lang.ada Path: gmd.de!ira.uka.de!sol.ctr.columbia.edu!usc!elroy.jpl.nasa.gov!swrinde!gatech!usenet.ins.cwru.edu!agate!linus!linus.mitre.org!linus!mbunix!eachus From: eachus@goldfinger.mitre.org (Robert I. Eachus) Subject: Re: Language lawyer needed In-Reply-To: davidg@oracorp.com's message of Thu, 1 Apr 1993 21:57:53 GMT Message-ID: Sender: news@linus.mitre.org (News Service) Nntp-Posting-Host: goldfinger.mitre.org Organization: The Mitre Corp., Bedford, MA. References: <1993Apr1.215753.3147@oracorp.com> Distribution: usa Date: Fri, 2 Apr 1993 16:40:13 GMT Date: 1993-04-02T16:40:13+00:00 List-Id: In article <1993Apr1.215753.3147@oracorp.com> davidg@oracorp.com (David Guaspari) writes: > Consider the following pathological program: procedure Q(x : integer) is begin declare x : integer; -- (1) begin Q(x => 0); -- (2) end; end Q; > My question concerns the legality of Q (forgetting about the fact that > its execution won't terminate). One way to apply chapter 8 in the > reference manual goes as follows: > The declaration of x in (1) hides the declaration of x as a formal > parameter of Q. So the name of the parameter is no longer directly visible, but is visible only by selection. Okay. > Therefore, by the visibility rules, the occurrence of x in (2) has > exactly one possible meaning, namely that given by the declaration > in (1). > However, the declaration in (1) is not visible by selection at the > point at which x occurs in (2). > Therefore the call in (2) is illegal. Nope. 8.3(6 & 11) say: Visibility is either by selection or direct. A declaration is visible by selection at places that are defined as follows. (e) For a parameter specification of a given subprogram declaration or entry declaration: at the place of the formal parameter (before the compound delimiter =>) in a named parameter association of a corresponding subprogram or entry call. So not only is the parameter X visible by selection, it is the only X visible so there is no problem. The terminology here is a little misleading. The or in 8.3(6) is not a choice, it really stands for "there are locations where visibility is determined using the rules for selection, other rules apply everywhere else." The first sentence of paragraph 8.3(14) is the offender here, it is technically correct but misleading: "Where it is not visible by selection, a visible declaration is said to be _directly_ visible." It says that visibility by selection preempts direct visibility, but seems to say that it applies on a name by name basis, rather than to the process of visibility as a whole. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...