--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Tue Nov  2 06:53:23 1993
--* Received: from yktvmv.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA13092; Tue, 2 Nov 1993 06:53:23 -0500
--* X-External-Networks: yes
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 1909; Sat, 30 Oct 93 17:30:33 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.SANTAS.NOTE.YKTVMV.5043.Oct.30.17:30:32.-0400>
--*           for asbugs@watson; Sat, 30 Oct 93 17:30:33 -0400
--* Received: from bernina.ethz.ch by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Sat, 30 Oct 93 17:30:31 EDT
--* Received: from neptune by bernina.ethz.ch with SMTP inbound id <21059-0@bernina.ethz.ch>; Sat, 30 Oct 1993 22:30:14 +0100
--* From: Philip Santas <santas@inf.ethz.ch>
--* Received: from rutishauser.inf.ethz.ch (rutishauser-gw.inf.ethz.ch) by neptune id AA26362; Sat, 30 Oct 93 22:30:10 +0100
--* Date: Sat, 30 Oct 93 22:28:36 +0100
--* Message-Id: <9310302128.AA24774@rutishauser.inf.ethz.ch>
--* Received: from vinci.inf.ethz.ch.rutishauser by rutishauser.inf.ethz.ch id AA24774; Sat, 30 Oct 93 22:28:36 +0100
--* To: smwatt@watson.ibm.com, bmt@watson.ibm.com
--* Subject: [f(y:SI):SI == g y where {local y:SI := 3; (z:SI):SI == z+1}; print(f 1)()] returns 2!
--* In-Reply-To: Mail from 'smwatt@watson.ibm.com (Stephen Watt)'
--*       dated: Sat, 30 Oct 1993 09:03:22 -0400
--* Cc: bronstei@inf.ethz.ch, jenks@watson.ibm.com, asbugs@watson.ibm.com

--@ Fixed  by:  SSD   Fri Nov 11 10:53:35 EST 1994 
--@ Tested by:  none 
--@ Summary:    Not a bug. '==' binds more tightly than where, so 'y' gets the parameter value instead of the local value in the call to foo. 


--The scopes in 'where' seem to be confused by the compiler:

--Consider the program:
---------------------------
#include "aslib"
SI ==> SingleInteger
import from SI

#if test1

foo(y:SI):SI == goo x where
   local x:SI := 3
   goo(z:SI):SI == z+1
print(foo 1)()
---------------------------
--It compiles/runs and returns 4 (which is what I expected).
--The variable 'x' in the LHS, has been defined as 3 in the RHS,
--and this is what is returned.

--Now, if I rename 'x' to 'y', I get strange results:

---------------------------
#else

foo(y:SI):SI == goo y where
   local y:SI := 3
   goo(z:SI):SI == z+1
print(foo 1)()

#endif

---------------------------

--This returns 2 (!). It should return 4 as before.
--I hope this is only a bug.

--Philip

 
