On Mar 20, 2013, at 06:29, Jonathan Scott wrote:
> Ref: Your note of Wed, 20 Mar 2013 12:02:22 +0000
>
> It is important to remember that macro statements are NOT
> processed by substituting variables within the original macro
> invocation statement before it is parsed, because this would then
> cause all sorts of odd effects when substituted variables
> happened to contain syntactically interesting characters such as
> spaces, equals signs, commas, parentheses and apostrophes.
> Instead, the macro invocation is parsed when the source is first
> encountered, BEFORE the values are substituted, and when the
> macro is invoked, substitution is applied within individual
> parameter values.
>
I appreciate the difficulty. But I note that POSIX shell
implements a highly effective solution to a similar problem.
Admittedly, HLASM's problem would be more complex because
HLASM supports keyword parameters; SH doesn't.
> For this reason, the only reliable way to pass through positional
> parameters to an inner macro at present is to use their
> individual names or to use separate &SYSLIST(n) entries as
> suggested by John Ehrman.
>
> John Bodoh wrote:
>> I like the idea of a new symbol; maybe &SYSARGS that is a read-only symbol
>> that is the entire argument to a macro including both
>> keyword and positional parameters. It would only have a scope of the
>> current macro. Thus, I could use it as a parameter to an
>> sub-macro being invoked: MACROX ...,&SYSARGS.
>>
Why read-only? I think again of POSIX shell's "set" command that
allows a script to modify its own parameter list.
I'd envision a more general syntax such as
&SYSARGS(i,j,k:l,m,...)
Where the resulting value is not a string, but a list, so that
each selected element would be associated with an individual
parameter of the called sub-macro, disregarding any effects
of "syntactically interesting characters" in that element.
>> I would be very surprised if I were the first person in the world in need of
>> such a capability.
>>
"What need one?" -- King Lear II.iv
-- gil