Program logic bugs vs input/environmental errors
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Wed Nov 12 12:39:54 PST 2014
On 11/12/2014 11:40 AM, "Ola Fosheim Grøstad"
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> On Sunday, 9 November 2014 at 21:44:53 UTC, Walter Bright wrote:
>> Having assert() not throw Error would be a reasonable design choice.
>
> What if you could turn assert() in libraries into enforce() using a compiler
> switch?
Forgive me for being snarky, but there are text editing utilities where one can:
s/assert/enforce/
because if one can use a compiler switch, then one has the source which can be
edited.
In any case, compiler switches should not change behavior like that. assert()
and enforce() are completely different.
More information about the Digitalmars-d
mailing list