D Conference Tango Phobos

kris foo at bar.com
Sat Sep 15 16:18:15 PDT 2007


TomD wrote:
>> This is only one of about four styles for IO, and it's probably the 
>> least commonly used these days.
> Why is this then the style in http://www.dsource.org/projects/tango/wiki/TutSimpleIO

Tango actually has two layers on the console:

1) a group of static objects called Cout, Cerr, and Cin

2) formatting wrappers called Stdout and Stderr

The former are low-level and support char[] only, while the latter do 
all kind of formatting and can be customized with optional I18N 
formatters, or redirected to your taste (into a memory accumulator, if 
you desire).

Cout doesn't support vararg at this time, being a low level idiom. It 
does, however, return itself for each call, so they can be chained. The 
documentation you linked above talks about the console only. No big deal?

There are those who stylistically prefer writeln() instead, and that's 
cool. I understand one of those folks is modifying the generic Layout 
facility in order to make it behave in a less class-like manner.

There's a variety of reasons why Tango does this differently from 
phobos, and we spent a lot of time debating each of those.

- Kris



More information about the Digitalmars-d mailing list