What's left for 1.0? - string class

Anders F Björklund afb at algonet.se
Sat Nov 18 03:47:51 PST 2006


Marcin Kuszczak wrote:

> Yes, that was my original proposal: dstring should be putted in standard
> library. Or at least: alias char[] string; I would be already happy about
> it.

I think both should go in Phobos. Both string alias and dstring struct.

> Processing utf-8 strings in different places in std library/compiler/user
> code instead of one string class I would rather consider bad practice...

I don't think classes should be required. Built-in UTF strings are nice.

>>We need D "char" to be a 1-byte type for all future, or this won't work:
>>extern (C) int printf(char *, ...);
> 
> Is it really not possible to solve? Maybe putting in extern(C) ubyte instead
> of char and allowing compiler silently translate it in this block to char
> for linking probably would solve problem...

It's not a technical problem. D wants the familiar C types as a feature.

I think using char and char[] (as "string") as an improvement over C
is OK, and then recommend dchar and dstring as the "D way" of doing it ?

And then if you use a real OOP stdlib like Mango, you move to String...
(using classes also offers one solution to the mutable/immutable issue)

Then D covers the entire "spectrum", from printf to writef to Writers.

--anders



More information about the Digitalmars-d mailing list