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

Craig Rasmussen crasmussen
Tue Jan 9 09:05:14 EST 2007


On Jan 2, 2007, at 1:30 PM, Bill Long wrote:

>
>
> 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).
>

I second Bill's suggestion to reserve {} for something more significant.

Regards,
Craig




More information about the J3 mailing list