First Impressions
Derek Parnell
derek at psyc.ward
Fri Sep 29 03:45:22 PDT 2006
On Fri, 29 Sep 2006 01:24:50 -0700, Walter Bright wrote:
> Derek Parnell wrote:
>> On Fri, 29 Sep 2006 10:23:32 +1000, Geoff Carlton wrote:
>>> I was a bit underwhelmed by the syntax of char[].
>>
>> Yes. It isn't very 'nice' for a modern language. Though as you note below a
>> simple alias can help a lot.
>>
>> alias char[] string;
>
> On the other hand, the reasons other languages have strings as classes
> is because they just don't support arrays very well. C++'s std::string
> combines the worst of core functionality and libraries, and has the
> advantages of neither.
>
> An early design goal for D was to upgrade arrays to the point where
> string classes weren't necessary.
And is it there yet? I mean, given that a string is just a lump of text, is
there any text processing operation that cannot be simply done to a char[]
item? I can't think of any but maybe somebody else can.
And if a char[] is just as capable as a std::string, then why not have an
official alias in Phobos? Will 'alias char[] string' cause anyone any
problems?
--
Derek Parnell
Melbourne, Australia
"Down with mediocrity!"
More information about the Digitalmars-d
mailing list