D Conference Tango Phobos
Steven Schveighoffer
schveiguy at yahoo.com
Fri Sep 14 09:12:17 PDT 2007
"Regan Heath" <regan at netmail.co.nz> wrote in message
news:fceb20$24n9$1 at digitalmars.com...
> Steven Schveighoffer wrote:
>> "Regan Heath" wrote
>> Perhaps to clarify that toString is not returning a tango.text.String,
>> maybe tango.text.String could be changed to tango.text.Utf8String? ;) I
>> see myself using toUtf8 way more than using tango.text.String, so I'd
>> rather have the annoyance there.
>
> I can understand the desire to avoid the confusion which would no doubt
> occur having Object.toString returning char[] in a library where a String
> class existed.
>
> Disclaimer: I haven't yet delved into Tango and actually used it for
> something, so I may have no idea what I'm talking about here next...
>
> I suspect the initial motivation for tango.text.String was to provide an
> invariant string type? and perhaps to bind member functions to the string
> type?
>
> So.. assuming we get a const which provides invariant char[] arrays and
> can call any function of the form R func(A) in the form A.func then is
> there any need for tango.text.String any more? (aside from the fact that
> it's probably used everywhere)
String has a lot of features in it. look at
http://www.dsource.org/projects/tango/docs/current/source/tango.text.String.html
I thought at first glance that String was an alias to StringView!(char),
which is derived from UniString(T), but String actually is also a template,
so my idea of String being renamed Utf8String is not correct.
I guess there could be another solution, but I won't try again :)
-Steve
More information about the Digitalmars-d
mailing list