DMD 1.021 and 2.004 releases
    Bill Baxter 
    dnewsgroup at billbaxter.com
       
    Thu Sep 13 01:24:48 PDT 2007
    
    
  
BCS wrote:
> Reply to Aziz K.,
> 
>> q"EOF
>> abcdefEOF" // Valid?
>>
>> Or is \nEOF a requirement? If so, how would you
>> write
>> such a string excluding the last newline?
> 
> q"EOF
> abcdef
> EOF"[0..$-1]
> 
Or peel off the last line:
q"EOF
abcdef
ghijkl
mnop
qrstuv
EOF"
"wxyz."
Still...
Why the draconian limitation that heredocs MUST always have a newline?
Seems like allowing escaped newlines would make life easier.  Like
q"EOF
abcdef
ghijkl
mnop
qrstuv
wxyz.\
EOF"
Or make only the last newline escapable with something prefixing the 
terminator, like \:
q"EOF
abcdef
ghijkl
mnop
qrstuv
wxyz.
\EOF"
--bb
    
    
More information about the Digitalmars-d-announce
mailing list