On 11/3/21 10:26 PM, Walter Bright wrote:
>https://issues.dlang.org/show_bug.cgi?id=22473
I've tried to fix this before, but too many people objected.
Are we fed up with this yet? I sure am.
Who wants to take up this cudgel and fix the durned thing once and for all?
(It's unclear if it would even break existing code.)
Honestly, I'd say foreach(dchar c; somestr)
should not work.
- It's slow and calls opaque functions
- Adds more requirements to runtime that are simply solved by basic wrappers.
- If writing wrappers, you can decide what you want.
- It gets people used to language-magic character conversion, when this doesn't work on ranges of
char
that aren't arrays -- which then performs integer promotion.
What I would not suggest though, is to just disable the feature. If it falls back to integer promotion (which is the worst thing ever for characters), then tons and tons of code will break, and much code will just work for English strings.
Autodecoding might be a huge problem with Phobos, but character promotion is a huge problem with the language.
-Steve