Make using compiled libs with debug code better

Tejas notrealemail at gmail.com
Tue Oct 19 04:59:23 UTC 2021


On Tuesday, 19 October 2021 at 03:09:16 UTC, Paul Backus wrote:
> On Tuesday, 19 October 2021 at 02:02:31 UTC, Tejas wrote:
>>
>> I thought `enforce` was our `-release` mode error checking 
>> mechanism?
>>
>> Why don't we encourage that instead of trying to change 
>> things(which will result in a battle of inertia).
>
> `enforce` and `assert` are not interchangeable. Walter 
> discusses the difference at length in this thread from 2014:
>
> https://forum.dlang.org/thread/m07gf1$18jl$1@digitalmars.com
>
> TL;DR: exceptions are for recoverable failures; assertions are 
> for non-recoverable failures.

I was thinking more about exceptions that should not be 
caught(the class `Error` inheriting from `object.throwable`).

Stuff like [this](https://dlang.org/phobos/object.html#.Error)


More information about the Digitalmars-d mailing list