(j3.2006) (j3.2005) Re: question on token replacement/concatenation

Aleksandar Donev donev1
Tue Jan 9 13:43:57 EST 2007

On Tuesday 09 January 2007 10:43, Bill Long wrote:

> On the other hand,
>  EXPAND M(X=(X=1))
>  seems pretty natural to me.
I am not necessarily opposed to this, but it is not "natural" to me simply 
because it is likely to lead to errors when people forget double parens. 
Parenthesizing macro actuals is common in order to pass expressions instead 
of variables to "inline" code and make sure the order of operations is 
correct. As in:

EXPAND ScaleVector(vector=x, scale=(1+delta))

Of course, good macro writing ought to put the parens around uses of the dummy 
in expressions, inside the macro itself, to make sure things work even if the 
user provides an expression as an actual. So maybe it is not that bad.

In any case, before arguing over which delimiter to use, the questions to 
answer are whether people agree with me that a good solution to the stated 
problem is to use (left/right) delimiters for the macro actuals, and if yes, 
whether we want to do this now for 2008. I obviously think we should do it 
earlier rather than later. Unfortunately I cannot make it to the Feb. meeting 
so I won't be there to discuss this, which is why I am trying to get feedback 
via e-mail.


Aleksandar Donev, Ph.D.
Lawrence Postdoctoral Fellow @ LLNL
High Performance Computational Materials Science and Chemistry
E-mail: donev1 at llnl.gov
Phone: (925) 424-6816  Fax: (925) 423-0785
Address: P.O.Box 808, L-367, Livermore, CA 94551-9900
Web: http://cherrypit.princeton.edu/donev

More information about the J3 mailing list