On Sunday, 18 December 2016 at 10:47:42 UTC, Stefan Koch wrote:
On Sunday, 18 December 2016 at 09:32:53 UTC, Caspar Kielwein wrote:
On Thursday, 15 December 2016 at 18:48:22 UTC, Andrei Alexandrescu wrote:
https://issues.dlang.org/show_bug.cgi?id=16975

I'd love if preconditions where available at the caller. This would make it possible to use preconditions for input scrubbing, even in release builds with disabled asserts.

That is exactly what they are not for.

I know that contracts are for specifying guarantees and conditions in regards to correctness of a program.

Still, at the first point where I call a function with user inputs, I often have to pretty much repeat the precondition of that function (but react different on violation) to scrub the inputs. I think it would be nice to be able to make the conscious choice of using the specified precondition for that.

Reply via email to