--* From postmaster%watson.vnet.ibm.com@yktvmv.watson.ibm.com  Wed Jun  9 09:31:14 1993
--* Received: from yktvmv2.watson.ibm.com by radical.watson.ibm.com (AIX 3.2/UCB 5.64/900524)
--*           id AA21585; Wed, 9 Jun 1993 09:31:14 -0400
--* X-External-Networks: yes
--* Received: from watson.vnet.ibm.com by yktvmv.watson.ibm.com (IBM VM SMTP V2R3)
--*    with BSMTP id 2783; Wed, 09 Jun 93 09:31:54 EDT
--* Received: from YKTVMV by watson.vnet.ibm.com with "VAGENT.V1.0"
--*           id <A.SANTAS.NOTE.YKTVMV.3275.Jun.09.09:31:54.-0400>
--*           for asbugs@watson; Wed, 09 Jun 93 09:31:54 -0400
--* Received: from bernina.ethz.ch by watson.ibm.com (IBM VM SMTP V2R3) with TCP;
--*    Wed, 09 Jun 93 09:31:53 EDT
--* Received: from neptune by bernina.ethz.ch with SMTP inbound id <6538-0@bernina.ethz.ch>; Wed, 9 Jun 1993 15:31:32 +0200
--* From: Philip Santas <santas@inf.ethz.ch>
--* Received: from rutishauser.inf.ethz.ch (rutishauser-gw.inf.ethz.ch) by neptune id AA28060; Wed, 9 Jun 93 15:31:26 +0200
--* Date: Wed, 9 Jun 93 15:31:24 +0200
--* Message-Id: <9306091331.AA21709@rutishauser.inf.ethz.ch>
--* Received: from ru7.inf.ethz.ch.rutishauser by rutishauser.inf.ethz.ch id AA21709; Wed, 9 Jun 93 15:31:24 +0200
--* To: asbugs@watson.ibm.com
--* Subject: macros
--* Cc: jenks@watson.ibm.com, bronstein, santas, williams

--@ Fixed  by: SMW Wed Jun 09 12:03:17 1993
--@ Tested by: n/a
--@ Summary:   Not a bug -- substitution is on trees not text


Some problems with the macro definitions:

x ==> (1)

f (1) (2)
parses as
((f 1) 2)

But

f x (2)
parses as
(f (1 2))

A second problem is the comma in the macros:

part1 ==> 1,2

foo(x:SI,y:SI,z:SI):SI == x+y+z

foo(part1,3)
does not compile, since part1 is only 1.

The 3rd problem (which is only sometimes a problem)
is that

sum ==> 3+4
sum*4

evaluates to 28, instead of the C-ish 19.
This means that the compiler parenthesizes the makro tokens.

In such case, even if we were allowing commas, we would have
problems with part1, since
foo(part1,3)
would be transformed into
foo((1,2),3)

Philip.

 
--+ You seem to be expecting textual substitution, as in C.  Macro substitution
--+ in A# is done on trees, as in Lisp.
--+ 
--+ Of the two, it was our opinion that textual substitution causes more
--+ problems than it solves.
--+ 
--+ So all of your observations are correct, and that is the way it is designed
--+ to work.
--+ 
--+ 
