[phobos] phobos commit, revision 1897

Jonathan M Davis jmdavisprog at gmail.com
Wed Aug 18 18:51:31 PDT 2010


On Wednesday, August 18, 2010 18:02:25 David Simcha wrote:
>  The default iteration type of narrow strings REALLY needs to be dchar.  It
> was painful to write the docs for ForeachType with this odd corner case
> sticking out like a sore thumb.

I believe that Walter has stated that that isn't going to happen because it 
silently breaks compatibility with D1. But it would certainly cause fewer 
problems dchar were the default. It's likely quite rare that someone would want 
something else, and you _know_ that it's going to cause a bunch of bugs in code 
somewhere where someone didn't understand the unicode situation properly or just 
plain forgot to put the type, but I guess we're stuck... 
http://d.puremagic.com/issues/show_bug.cgi?id=4483 suggests that it be made a 
warning to not specify the type when iterating over an string type not made up 
of dchars, but even if that were done, it wouldn't help with generic code. 
strings in general don't seem to play well with generic code in general really, 
though we've obvously found ways to make them work.

- Jonathan M Davis


More information about the phobos mailing list