DIP9 -- Redo toString API

Nick Sabalausky a at a.a
Sun Nov 21 07:25:01 PST 2010


>"spir" <denis.spir at gmail.com> wrote in message 
>news:mailman.532.1290349037.21107.digitalmars-d at puremagic.com...
>On Sun, 21 Nov 2010 15:55:10 +0100
>Pelle Månsson <pelle.mansson at gmail.com> wrote:
>
>> > But the key point is that language features like D's toString are far 
>> > to be used only for _direct_ string output. They are extremely useful 
>> > for numerous tasks of string manipulation and processing, most of which 
>> > again for programmer's own use. Sometimes, at the end of process chain 
>> > comes string otuput -- but indirectly.
>>
>> With this, it doesn't need to be. Instead of writing another function
>> for non-debuglike string output, just use writeTo.
>
>No, just use toString. As said above, I don't want to writeTo, I want the 
>string; and be free to do whatever I want to with it. Being only able to 
>write is... (rather censure).

If you just want the string, then just use to!string(x), or format("%s", x), 
or anything else that implicity converts types to strings. I don't 
understand what the problem is.




More information about the Digitalmars-d mailing list