What's left for 1.0? - string class

Marcin Kuszczak aarti at interia.pl
Sat Nov 18 03:11:22 PST 2006


Anders F Björklund wrote:

> Aarti_pl wrote:
> 
>> Making size of char equal to 4 bytes, and having string class, which can
>> optimize different encodings would allow to get rid of all magic... :-)
> 
> I think that using dchar and the proposed "dstring" struct* would work ?
> (not that I think it becomes less magic if you hide it behind a curtain)
> 

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.

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

> 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...


> 
> --anders
> 
> * http://www.dprogramming.com/dstring.php

-- 
Regards
Marcin Kuszczak
(Aarti_pl)



More information about the Digitalmars-d mailing list