News for hackers. Stuff that matters.
Re:Preconditions Should be Checked Explicitly by Strilanc on Tuesday April 02, 2013 @03:28PM (#5481580)
I think it's a better idea, in some languages at least, to extend the signature to contain general preconditions and postconditions.

    public boolean doSomethingFor(int iterations) {
        // this is considered part of the semantic signature
        requires iterations > 0 && iterations < 10;
        
        // implementation
        ...
    }
Putting it in the types is a good idea, but extremely complicated. You need full dependent types to make it work.

There are no comments on this comment yet.