[Issue 14519] [Enh] foreach on strings should return replacementDchar rather than throwing

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat May 2 03:47:18 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14519

--- Comment #26 from Vladimir Panteleev <thecybershadow at gmail.com> ---
(In reply to Sobirari Muhomori from comment #21)
> Libraries don't determine on which data the program operates, it depends on
> the program and its environment, encoding mismatch has large scale
> consequence too: program crashes or corrupts data, libraries don't decide
> how to behave in such cases, it's a property of the program as a whole.
> Since they can't decide how to behave in such cases, they shouldn't decide
> and thus can't have different expectations on this matter, it's a
> per-program aspect.

No. Almost nothing is a per-program aspect. A program may contain within itself
a large number of big components, each functioning more-or-less independently,
each of which which might have been single programs or even a collection of
programs. If something prevents you from designing such a system, this
indicates underlying encapsulation flaws. Such global changes of behavior as
you are proposing can affect a component which is used by a second component,
which is used by a third component etc. - and something along that line is
likely to expect failures to occur in a predictable way.

--


More information about the Digitalmars-d-bugs mailing list