Thread overview
[phobos] phobos commit, revision 1897
Aug 19, 2010
dsource.org
Aug 19, 2010
David Simcha
Aug 19, 2010
Jonathan M Davis
August 18, 2010
phobos commit, revision 1897


user: dsimcha

msg:
Added isIterable, ForeachType to std.traits in preparation for improvements to std.array.array.

http://www.dsource.org/projects/phobos/changeset/1897

August 18, 2010
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20100818/50755803/attachment-0001.html>
August 18, 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