questions on PhanTango 'merger' (was Merging Tangobos into Tango) - long-term vision

Chad J gamerChad at _spamIsBad_gmail.com
Thu Oct 11 05:08:32 PDT 2007


Lars Ivar Igesund wrote:
> 
> How on earth is
> 
> Cout("somestring"); more "complex" than writef (write actually)?
> 

ooo, something I have issue with...

Cout doesn't do formatting.
Stdout doesn't do formatting.

So
writefln("number: %d", number);
becomes
Stdout.formatln("number: {0}", number);
Why doesn't plain Stdout do this?

Oh, and even if it did,
Stdout("number: {0}", number);
would not insert a newline.

I have to use
Stdout("number: {0}", number).newline;
instead, which is again more typing.  I have to type this stuff a lot, 
so I'd like it to be easy.

It would be really nice to have
Stdout("number: {0}", number).nl; // .nl for "newline" or .ln for "line"
as a start.  Shorthand is useful in some cases.

It would be straight awesome to have
Stdout("Point(op1[{0},{1},{2}],",x,y,z)("op2[{0},{1},{2}])",t,u,v).nl;
It also scales nicely.  You don't need to understand the above line to 
write a simple Stdout("Hello world!");.

As I understand it, Cout is a bit more lightweight or somesuch, so I 
don't really have any issues with it, other than that maybe it should be 
hidden away as something only experienced tango users should play with 
as a means of optimizing their programs.

Text output seems easy enough to generalize, so in that case just stick 
to one /single/ canonical way of doing it that works really well and 
scales.



More information about the Digitalmars-d mailing list