comp.lang.ada
 help / color / mirror / Atom feed
From: berman@umbc.edu (Mike Berman)
Subject: Re: Language lawyer needed
Date: 2 Apr 1993 10:39:32 -0500
Date: 1993-04-02T10:39:32-05:00	[thread overview]
Message-ID: <1phmnkINN9e0@umbc4.umbc.edu> (raw)


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



             reply	other threads:[~1993-04-02 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-04-02 15:39 Mike Berman [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-04-09 22:33 Language lawyer needed cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!noc.n
1993-04-08 18:10 Robert I. Eachus
1993-04-07 22:34 agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-s
1993-04-02 16:39 Wes Groleau X7574
1993-04-01 21:57 David Guaspari
1993-04-02 13:57 ` Dave Collard x7468
1993-04-02 16:40 ` Robert I. Eachus
1993-04-02 19:37 ` Tucker Taft
1993-04-02 23:07 ` Rich Messenger
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox