toString vs. toUtf8

Christopher Wright dhasenan at gmail.com
Tue Nov 20 16:55:46 PST 2007


Bill Baxter wrote:
> Sean Kelly wrote:
>> As an alternative, I can only suggest that toUTF8, toUTF16, and 
>> toUTF32 be named toString, toWString, and toDString, respectively, and 
>> Unicode should be assumed as the standard encoding format in D.
> 
> 1) On the question of toWString vs toWstring and consistency:
> 
> I don't think there's any clear precedent for either in Tango right now, 
> but my question is, if tango *had* a "to uint" function, what would it 
> be named?  toUInt or toUint?  Whatever the answer to that is should be 
> the same as the answer to how to name a "to wstring" function.

If it had a to uint function and a to int function and a to 'sint' 
function, what then? If it's only uint, then you can tell the difference 
quite easily.

Also, 'int' is shorter than 'string'. Not a very good comparison.



More information about the Digitalmars-d mailing list