Re: C String Prefix Operator Idea (Was: gfortran diagnostics and so on)
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

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

Group: comp.lang.fortran · Group Profile
Author: Gary Scott
Date: Nov 24, 2007 17:43

glen herrmannsfeldt wrote:
> jamesgiles@att.net wrote:
>
>> On Nov 24, 4:27 pm, Gary Scott sbcglobal.net> 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"?

Fairly minor, you still have existing literals processed exactly as
expected. Special processing only by application of special syntax.
>
>
> 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
>
I wasn't intending to limit to compile time only. This type of
substitution already exists in many products I use. It is extremely
useful. Yes, it would require some run-time support. Come on guys,
show a little imagination.

--

Gary Scott
mailto:garylscott@sbcglobal dot net

Fortran Library: http://www.fortranlib.com

Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html

If you want to do the impossible, don't hire an expert because he knows
it can't be done.

-- Henry Ford
no comments
diggit! del.icio.us! reddit!