Why foreach(c; someString) must yield dchar

Michel Fortin michel.fortin at michelf.com
Thu Aug 19 04:48:03 PDT 2010


On 2010-08-18 22:37:04 -0400, dsimcha <dsimcha at yahoo.com> said:

> If D is at all serious about generic programming, we simply can't require this
> to be dealt with **everywhere** as a special case.

I do agree that the current special case situation is pretty bad. 
Foreach really need to use ElementType!string by default. Whether this 
is done by changing foreach (my preference), or by reverting 
ElementType!string to its previous incarnation and using a special 
range to iterate over characters, I think it'd be an improvement over 
the current situation. Having the standard library and the language 
disagree with each other is be pretty bad.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list