Tango 0.95 beta1 released

Sean Kelly sean at f4.ca
Thu Feb 1 08:21:37 PST 2007


Lionello Lunesu wrote:
> kris wrote:
>>
>> 2) there's no toUtf16() and toUtf32()? This is not the case. Tango 
>> uses those in a number of modules to do just what they indicate. There 
>> are modules that expose all three ... in certain cases they're also 
>> templated for the base type that you want stored within (e.g. store as 
>> dchar, expose as all three types).
> 
> Obviously, I was talking about Object.toString. Changing Object creates 
> unnecessary incompatibilities.

This was a difficult decision for us.  Technically, Object.toString 
doesn't return a string, it returns a char array (ie. a sequence of 
UTF-8 characters).  Thus, toUtf8 is a more meaningful term for what the 
method actually does.  Another reason we chose this route is because 
Tango has a string class, and toString suggests that an instance of this 
class would be returned.  I suppose it's worth mentioning, however, that 
toString support for structs has not been changed because it is a 
compiler feature, and the disparity bothers me.  Fortunately, toString 
isn't required for IO in Tango so the issue hasn't come up in practice.


Sean



More information about the Digitalmars-d-announce mailing list