std.locale

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Mar 2 06:06:45 PST 2009


Georg Wrede wrote:
> *** How to print arrays ***
> 
> You print arrays in a predictable and expected way.
> 
> D array printing is for non-GUI stuff. Hence, you use the C locale, period.

I think the C locale (or any predefined locale) tells what left bracket 
I should use for array, what separator, and what right bracket. For now 
the left and right brackets were eliminated because the user can easily 
add them on the caller side. The separator is a space simply because it 
looks the least harmful. But for example I don't have a good solution 
for what to print as the separator between a hash key and a hash value. 
A simple, extensible locale support would have allowed me to stop 
worrying about that.

Also, D array printing is not only for console - a GUI may use to!string 
with arrays.

But overall I guess I'll let myself bludgeoned into complacency...


Andrei



More information about the Digitalmars-d mailing list