RFC: Change what assert does on error
Adam Wilson
flyboynw at gmail.com
Fri Jul 4 07:56:54 UTC 2025
On Friday, 4 July 2025 at 07:24:33 UTC, Walter Bright wrote:
> This whole discussion seems pointless anyway. If you want to
> unwind the exception stack every time, use enforce(), not
> assert(). That's what it's for.
That's not up to me as any two-bit library could use assert()
instead of enforce(). What you're really saying is "Never use
assert() anywhere ever, always use enforce()", which means we can
safely deprecate and remove assert() from the language.
In User Interface Design, a key principle is always make the
default response the sane response. If the sane response is
enforce(), then enforce() needs to be the default. Or you make
assert() behave like enforce(), because the sane response is
enforce().
More information about the Digitalmars-d
mailing list