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, T_FILL_THIS_FORM_SHORT 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 08:17:15 PST Path: gmd.de!ira.uka.de!yale.edu!yale!gumby!destroyer!gatech!swrinde!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!haven.umd.edu!news.umbc.edu!nobody From: berman@umbc.edu (Mike Berman) Newsgroups: comp.lang.ada Subject: Re: Language lawyer needed Date: 2 Apr 1993 10:39:32 -0500 Organization: University of Maryland, Baltimore County Campus Distribution: usa Message-ID: <1phmnkINN9e0@umbc4.umbc.edu> References: <1993Apr1.215753.3147@oracorp.com| NNTP-Posting-Host: umbc4.umbc.edu Date: 1993-04-02T10:39:32-05:00 List-Id: Arf! Sorry about that last posting - I just discovered that my newsreader chokes on reposted dead.articles. Here's the relevant part: davidg@oracorp.com (David Guaspari) writes: | Here's a question for language lawyers. Hopefully an Ada instructor will do. | 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. | | Therefore, by the visibility rules, the occurrence of x in (2) has | exactly one possible meaning, namely that given by the declaration | in (1). | Therefore the call in (2) is illegal. Visibility is not defined for just identifiers. The section of the LRM to which you are referring describes rules "for each identifier and at each place in the text." Like the real estate biz, the important thing in your example is location, location, location. The occurrence of x in (2) clearly can only be a subprogram parameter for procedure Q. -- Mike Berman University of Maryland, Baltimore County Fastrak Training, Inc. berman@umbc.edu (301)924-0050