comp.lang.ada
 help / color / mirror / Atom feed
From: dlc@ddsdx2.jhuapl.edu (Dave Collard x7468)
Subject: Re: Language lawyer needed
Date: Fri, 2 Apr 93 13:57:07 GMT
Date: 1993-04-02T13:57:07+00:00	[thread overview]
Message-ID: <1993Apr2.135707.25298@aplcen.apl.jhu.edu> (raw)
In-Reply-To: 1993Apr1.215753.3147@oracorp.com

In <1993Apr1.215753.3147@oracorp.com> davidg@oracorp.com (David Guaspari) writes:

>Here's a question for language lawyers.

>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). 

>  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.

The 'x' in (2) does not refer to a variable -- it is
part of a named parameter association and has
nothing to do with the visibility of either the formal parameter
'x' or the 'x' declared in (1).  Q is visible at (2)
with the correct parameter and result type profile -- that is
the name 'x' is indeed a formal parameter of Q and the actual 
0 matches the integer type of that parameter.


--Thor
dlc@ddsdx2.jhuapl.edu



  reply	other threads:[~1993-04-02 13:57 UTC|newest]

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

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