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

Bill Long longb
Tue Jan 2 15:30:36 EST 2007



Aleksandar Donev wrote:

>
>
>EXPAND M(X=X=1)
>
>which is again ambiguous to parse.
>
>I propose that we add a new delimiter for macro actual arguments, which allows the inclusion of an equals sign in the token sequence without ambiguity or difficulty reading the EXPAND statement. I propose that curly braces be used for this purpose. The curly braces do not actually contribute to the Fortran source code produced by the macro expansion; they are merely used as delimiters. Therefore this use of curly braces does not preclude their future use in Fortran syntax. Using this delimiter, the above example would become:
>
>EXPAND M(X={X=1})
>

Suppose we do decide on a future syntax use for { } in actual Fortran 
statements.  I seems like we could run into a new set of conflicts with 
your proposed usage in macros.  If those conflicts can be overcome, then 
it would seem that the same conflicts could be resolved if you chose to 
use ( ) as the delimiters for the macro arguments instead. For example, 
the outermost enclosing parens around a macro actual argument are 
removed before substitution takes place.    I'd rather reserve { } for 
something more significant.  Perhaps enclosing an inline macro implied 
DO construct that could be used to form variable length lists (to 
generate rank-independent subscript lists, for example).

Cheers,
Bill


-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120

            





More information about the J3 mailing list