Re: Tidier pre/post conditions

2010-02-27 Thread Lutger
Just practically speaking, not being able to call any non-pure functions is real pain. You can't even call to!string for example. I like your original suggestion, thanks for putting it it in bugzilla. I hope it will considered some day. By the way, I just discovered contract programming is ama

Re: Tidier pre/post conditions

2010-02-27 Thread bearophile
BCS: > Logging? Any pre conditions that require external services ("DNS names should > have been checked at this point.", "key must exist in the DB")? > Those wouldn't work but I'm not sure how much of an issue they are. Such usages are not common, and the program behaviour can change between re

Re: Tidier pre/post conditions

2010-02-26 Thread BCS
Hello bearophile, (can you invent situations where this is too much restrictive?), Logging? Any pre conditions that require external services ("DNS names should have been checked at this point.", "key must exist in the DB")? Those wouldn't work but I'm not sure how much of an issue they are

Tidier pre/post conditions

2010-02-26 Thread bearophile
Generally a program can produce different outputs between release and not release mode, but I always like to minimize the probability of this. Two examples: --- import std.stdio: writeln; void foo(int[] arr) out { arr[0] = 0; } body {} void main() { auto a = [1, 2]; foo(a)