Re: C String Prefix Operator Idea (Was: gfortran diagnostics and so on)



jamesgiles@xxxxxxx wrote:

On Nov 24, 4:27 pm, Gary Scott <garylsc...@xxxxxxxxxxxxx> wrote:

The substitution I'm referring to only applies to the token that is
inserted into the literal string, exactly the same as an escape sequence
is inserted. If you want to define some more sophisticated substitution
process, that's fine by me, but I would be fine with a minor extension
to the escape substitution being proposed.

%1 = "is"

A whole new class of identifier is "a minor extension"?

i.e. "the string %1 short"

So, string "literals" are not only *not* literal (meaning
the same as their appearance) but aren't even compile-time
constants anymore? And that's "a minor extension"?

My understanding is that he means a compile time substitution.
That is, the % variables are compile time variables.

The PL/I preprocessors has compile time variables, I don't remember
if it does substitution inside string constants. One of the old
favorites is unrolling a loop:

%do i=1 to 10;
a(i)=b(i)*c(i);
%end;

will compile to 10 assignment statements.

-- glen

.



Relevant Pages