--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Sat Jun  5 22:57:11 1993
--* Received: from yktvmv2.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA15180; Sat, 5 Jun 1993 22:57:11 -0400
--* X-External-Networks: yes
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 8305; Sat, 05 Jun 93 22:57:49 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.SANTAS.NOTE.YKTVMV.3049.Jun.05.22:57:48.-0400>
--*           for asbugs@watson; Sat, 05 Jun 93 22:57:49 -0400
--* Received: from bernina.ethz.ch by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Sat, 05 Jun 93 22:57:47 EDT
--* Received: from neptune by bernina.ethz.ch with SMTP inbound id <15576-0@bernina.ethz.ch>; Sun, 6 Jun 1993 04:57:43 +0200
--* From: Philip Santas <santas@inf.ethz.ch>
--* Received: from rutishauser.inf.ethz.ch (rutishauser-gw.inf.ethz.ch) by neptune id AA02011; Sun, 6 Jun 93 04:57:40 +0200
--* Date: Sun, 6 Jun 93 04:57:38 +0200
--* Message-Id: <9306060257.AA21791@rutishauser.inf.ethz.ch>
--* Received: from ru7.inf.ethz.ch.rutishauser by rutishauser.inf.ethz.ch id AA21791; Sun, 6 Jun 93 04:57:39 +0200
--* To: asbugs@watson.ibm.com
--* Subject: where vs. package
--* Cc: bronstein, santas, jenks@watson.ibm.com

--@ Fixed  by:  SSD   Wed Jun 29 12:56:05 EDT 1994 
--@ Tested by:  none 
--@ Summary:    Not a bug. Code contains errors regarding package calling, categories, category defaults, scope of definitions and assignments. 



With anonymous packages we can simulate the 'where'
construct, without having all these restrictions with the
scope of constants:

The following program compiles:

-------------wherePackage.as------------------
#include "aslib.as"
SI ==> SingleInteger
import SI
op1: SI == 4
print(op1$(with (op1:SI) add (op1:SI==3)))()
----------------------------------------------

The *equivalent* program with where constructs is:

------------whereWhere.as------------------------
#include "aslib.as"
SI ==> SingleInteger
import SI
op1: SI == 4
print(op1)() where
      local op1: SI == 3
-------------------------------------------------

which does not compile. Do we really want the difference?

Philip

 
--+ Rules of the language:
--+ 
--+ '==' introduces definitions which may be overloaded.
--+ ':=' performs assignments; can implicitly introduce a local variable
--+      which will shadow outer variables.
--+ The keyword 'local' makes the introduction of a local variable explicit.
--+ 
--+ Examples:
--+ 
--+ -- Two meanings for op1:
--+ op1: SI == 4;
--+ op1 where {
--+       local op1: SI == 3;
--+ }
--+ 
--+ -- Two meanings for op1:
--+ op1: SI == 4;
--+ op1 where {
--+       op1: SI == 3;
--+ }
--+ 
--+ -- One meaning for op1:
--+ op1: SI == 4;
--+ op1 where {
--+       op1: SI := 3;
--+ }
--+ 
--+ More rules of the language:
--+ 
--+ The keyword 'default' is used to specify default packages in categories.
--+ Operations are exported from domains.
--+ Domains inherit operations from categories.
--+ Categories themselves export no operations.
--+ 
--+ More examples:
--+ 
--+ -- Zero meanings for op1 in the package call,
--+ -- no defaults for op1:
--+ op1: SI == 4
--+ op1$(with { op1: SI; add { op1: SI == 3; }})
--+ 
--+ -- Zero meanings for op1 in the package call,
--+ -- two meanings for op1 in the default body:
--+ op1: SI == 4
--+ op1$(with { op1: SI; default { op1: SI == 3; }})
