(j3.2006) (j3.2005) Re: question on token replacement/concatenation
Aleksandar Donev
donev1
Wed Jan 3 17:27:36 EST 2007
On Monday 01 January 2007 22:24, Aleksandar Donev wrote:
> R340 macro-actual-arg-value is basic-token-sequence
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? or { delimited-basic-token-sequence }
In private discussion Mike brought up a good point: At present curly braces
are not lexical tokens (they are merely characters) and it would be weird to
have syntax rules contain non lexical tokens.
I will ammend the paper to make { and } lexical tokens (delimiters). There
still remains the question of whether the token sequence for macro actuals
should be allowed to contain curly braces? I don't see why not, as long as
they are matched. So this:
DEFINE MACRO M(X)
EXPAND N(Y=X)
END MACRO
EXPAND M({{A=2}})
will produce the same output as:
EXPAND N(Y={A=2})
Thanks,
Aleks
--
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