(j3.2006) Macro questions

Aleksandar Donev donev1
Mon Feb 5 14:36:54 EST 2007

On Sunday 04 February 2007 18:07, Malcolm Cohen wrote:

OK, got it.
> should we even contemplate handling 
> ? X %% Y Z
> with an absent Y as
> ? X Z
> instead of
> ? X %% Z
In this case, I would not add any prohibitions at all. Macro OPTIONALs are not 
like other OPTIONAL dummies in that they have a well-defined initial value 
(something some want for all such dummies, but that is a different story). So 
using them (other than as arguments to PRESENT) even if they are not PRESENT 
is fine.

Instead, we should concentrate on making untyped macro variables that evaluate 
to a null token sequence to behave well and as users would expect. Dick 
actually pointed out a problem in the syntax: 
"Page 35, lines 32-33 say these things begin
as a null string.  The syntax rules R335, 336, and 338 seem to disallow
assigning a null string to one of them.  But, page 40, line 36 says that
the right hand in a macro assignment can be empty.  I think this is just
an error in the syntax rules."

Here is an example:


where A and B are optional non-present dummies. I think this should be fine 
and allowed. Is it?


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