Thread overview
Is the supposed to work?
Jan 07, 2006
BCS
Jan 07, 2006
Chris Sauls
Jan 12, 2006
Bruno Medeiros
Jan 21, 2006
S. Chancellor
January 07, 2006
import std.stdio;
void main()
{
writef(\\\n);
}


January 07, 2006
BCS wrote:
> import std.stdio;
> void main()
> {
> writef(\\\n);
> }
> 

Yes.  Some quotes from http://digitalmars.com/d/lex.html :

"A string literal is either a double quoted string, a wysiwyg quoted string, an escape sequence, or a hex string."

"Adjacent escape strings are concatenated"

"Adjacent strings are concatenated with the ~ operator, or by simple juxtaposition"

So that code is supposed to be exactly the same as:
import std.stdio;
void main()
{
writef("\\\n"c);
}

-- Chris Sauls
January 12, 2006
BCS wrote:
> import std.stdio;
> void main()
> {
> writef(\\\n);
> }
> 
> 

Damn, this looks so unnatural. Is there any reason for escape sequences do be allowed out of quoted literals?


-- 
Bruno Medeiros - CS/E student
"Certain aspects of D are a pathway to many abilities some consider to be... unnatural."
January 21, 2006
Bruno Medeiros <daiphoenixNO@SPAMlycos.com> wrote:
>BCS wrote:
>> import std.stdio;
>> void main()
>> {
>> writef(\\\n);
>> }
>> 
>> 
>
>Damn, this looks so unnatural. Is there any reason for escape sequences do be allowed out of quoted literals?
>


Yeah I thought it was some kind of bug with DDoc. lol.

-S.

-- 
Email works.