dmd foreach loops throw exceptions on invalid UTF sequences, use replacementDchar instead

Walter Bright newshound2 at digitalmars.com
Fri Nov 5 00:50:38 UTC 2021


On 11/4/2021 7:52 AM, jfondren wrote:
> Emitting the 
> replacement character is also a reasonable default, and objections in the thread 
> can be answered the same way that objections to throwing can be: if you don't 
> like it, iterate some other way:

Technically, you are correct. But experience shows this does not work, because 
people will be human.

Two things are abundantly clear:

1. throwing exceptions must not be default behavior

2. allocating with the GC must not be the default behavior

and pushing against that is like trying to get people to eat their vegetables.


More information about the Digitalmars-d mailing list