toString issue

Sean Kelly sean at f4.ca
Sat Sep 30 08:03:35 PDT 2006


Johan Granberg wrote:
> As a result of the discussion about char[] above I have been converting 
> some of my code from dchar[] to char[], but that reminded me of an issue 
> i have with the current state of phobos. in object their is the method 
> toString that happened to have the same name as the COMMONLY used 
> function std.string.toString this causes objects toString to shadow 
> std.strings to string inside class methods. I know that FQN can be used 
> as a workaround but it makes the code unnecessary hard to read and I 
> think that name clashes such as this should be avoided in the standard 
> library.
> 
> PROPOSAL. change all methods in object to have some prefix for to string 
> I suggest opString as the op prefix is already in use.

How about toUtf8() for classes and structs :-)


Sean



More information about the Digitalmars-d mailing list