toString vs. toUtf8

Kris foo at bar.com
Tue Nov 20 22:32:07 PST 2007


"Sean Kelly" <sean at f4.ca> wrote in message 
news:fhvsaf$2k6t$1 at digitalmars.com...
> 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.
>
> Good question.  Probably toUInt, though I don't like it much :-)  For 
> these conversion routines, I'll admit I find the idea that the type name 
> should be repeated exactly, which suggests something like to_wstring, but 
> I don't imagine anyone finds that appealing.


It was resolved by having a Float module and an Integer module, containing 
relevant parse/format methods. The toUtf/toString() family is the only one 
where the type is decorated in the name (hungarian style)





More information about the Digitalmars-d mailing list