Re: [sv-bc] Mantis 1571: proposal for macro defaults

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Mon Nov 26 2007 - 09:07:44 PST
Bresticker, Shalom wrote:
> Hi, Gord. 
> 
>> What about the following:
>>
>>     `define M1(a) `M2('"a'")
> 
> Did you mean back-tics instead of apostrophes?

Yes, sorry about that.

> 
> Currently the LRM says,
> 
> "The 'define macro text can also include `", `\`", and ``."
> 
> This implies that these special combinations have their special meanings
> only in the macro text and not in the macro arguments. That does not
> mean that you can't use them in actuals or defaults. It just means that
> they are not interpreted specially there and just inserted as is into
> the macro text. But it may affect how the arguments are parsed. Suppose
> there is a comma there, for example.
> 
> If there is any controversy about this at all, I would just avoid the
> issue in this Mantis by saying that defaults have the same restrictions
> as actuals. The issue already exists today with actuals. Introducing
> defaults does not introduce any new issue. Whether or not `" can be used
> in actuals should be part of Mantis 1338.

The problem that I have in this area and with your suggestion is that
we have to be really careful about what constitutes the special `"
token.

I certainly do not agree that `" is just "text" in the example I
gave.  In a use outside of macro text, I would agree.  So, for
example, I think that:
     `M2(`"a`")
in normal text is different from:
     `define M1(a) `M2(`"a`")

In the first case, the `" sequences do not retain their special
status; in the second they do (I think).

Gord.

> 
> Thanks,
> Shalom
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
> 
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Nov 26 09:08:06 2007

This archive was generated by hypermail 2.1.8 : Mon Nov 26 2007 - 09:08:15 PST