www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Is the supposed to work?

reply BCS <BCS_member pathlink.com> writes:
import std.stdio;
void main()
{
writef(\\\n);
}
Jan 06 2006
next sibling parent Chris Sauls <ibisbasenji gmail.com> writes:
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
Jan 07 2006
prev sibling parent reply Bruno Medeiros <daiphoenixNO SPAMlycos.com> writes:
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."
Jan 12 2006
parent S. Chancellor<dnewsgr mephit.kicks-ass.org> writes:
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.
Jan 20 2006