Tango quibbles - please write tickets so we can track them

Matti Niemenmaa see_signature at for.real.address
Sun Sep 16 06:20:45 PDT 2007


kris wrote:
> In other words, Tango formatting does not do a char-by-char output. Instead,
> it does a char[] slice by char[] slice, which is more efficient for a number
> of reasons.

Ah yes, good point. Phobos does it one dchar at a time, which allows it to do
things the way it does.

> Perhaps you're redirecting console output to a file, and expecting to see
> \r\n in there instead of a \n?

Yes.

Personally, I don't care that much, but it can be necessary for interoperability
reasons, which is why I now tend to use .newline "just in case" anyway.

> Stream filters are just cool anyway, and you /could/ use them to 
> *dynamically* switch the behavior to produce Mac or *nix newlines instead. 
> Worth considering?

Sure!

> Oh, and the .print/.newline thing you ran into is just a weird thing with D. 

Yeah, I know, but it makes sense, because it would be ambiguous otherwise. I
suppose I could do '(Stdout("foo").newline)("bar").newline' or something, but
that's too ugly and even more annoying to type than .print. :-)

A thought: would it be possible to have an overload like:

typeof(this) newline(T[] s) { this.newline.print(s); }

Unless that raises arcane compilation problems it should be helpful, no?

-- 
E-mail address: matti.niemenmaa+news, domain is iki (DOT) fi



More information about the Digitalmars-d mailing list