(j3.2006) (j3.2005) Re: question on token replacement/concatenation
Mon Jan 22 17:11:53 EST 2007
Michael Ingrassia wrote:
>> I'd invoke the macro with p1 as a null macro argument
> I thought a null macro argument wasn't permitted?
> A macro-actual-arg-value is a
> a basic-token-sequence always seems to start with
> either a basic-token or a left paren or an lbracket ,
> and a basic-token is any lexical token (with some exceptions).
> Or are you talking about the case where the macro actual argument just doesn't
> appear, because the macro dummy argument is optional ?
> --Michael I.
Mike sent me this in reply to my j3 e-mail today about tokens.
I'm not sure if he intended to respond to the entire list or not.
But, I'll assume he wanted to.
Actually, I was confused at a higher level. I thought we could
have and manipulate null macro untyped variables. These are the new
things added last meeting. 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. If I should happen to want a local
variable that sometimes has a token string and is sometimes empty, I
can easily do it with a helper variable that is only used as a single
token on the right of the equals. Surely, we didn't mean that.
Unless someone strongly objects, I'll do a place holder proposal
about the syntax contradicting the text. I'll also suggest that
Note 3.14 be rewritten to use macro assignment.
So, I think this leaves my original question still open. Do we
want to allow people to manipulate macro things that have an "_"
or "%" as the leading character (or maybe don't qualify as lexical
tokens for some other reason)?
More information about the J3