Output contract's arguements

w0rp devw0rp at gmail.com
Wed Sep 18 05:30:42 PDT 2013


There are probably implementation reasons for it working this 
way. I think it's perfectly acceptable for the majority of cases, 
and for the edge cases where you want something like this, you 
can of course always do this.

void foo(int y)
out(val) {
    ...
} body {
    int val;

    ...

    assert(y != 0);

    return val;
}

Of course, you'd need to return only at the end of the function 
for that, but there are ways around that, like inner functions, 
or perhaps goto end. (Although I don't advocate use of goto.)


More information about the Digitalmars-d mailing list