Make using compiled libs with debug code better

Paul Backus snarwin at
Tue Oct 19 00:00:48 UTC 2021

On Monday, 18 October 2021 at 23:37:51 UTC, jfondren wrote:
> Nim has the same division, with the opposite default, in 
> `assert` (erased in release builds) and `doAssert` (retained in 
> release builds). D can simulate a bunch of different kinds of 
> asserts by abusing dmd flags and different places that asserts 
> can appear in - function bodies, contract bodies, unittests, 
> and debug statements, version blocks, but what D's missing is 
> the *convention* of using these asserts differently.

My guess is that if we changed the behavior of `-release`, D 
programmers would learn the new convention pretty quickly.

Even if they didn't, though, the change is fail-safe--it will not 
break any code that isn't already broken in debug builds. So as 
compiler changes go, this one is relatively low-risk.

More information about the Digitalmars-d mailing list