On Wednesday, 14 December 2016 at 17:32:10 UTC, H. S. Teoh wrote:
What about:

        /* Showing full declaration just for context */
        bool myFunc(R1, R2)(R1 r1, R2 r2)
        import {
                std.range : isInputRange,
                std.traits : isNum = isNumeric
        }
        if (isInputRange!R1 && isInputRange!R2 &&
            isNum!(ElementType!R1))
        in { assert(someCondition!R1); }
        out(result) { assert(result == expectedResult(...)); }
        body
        {
                ...
        }


T

The fact that declarations like this WILL show up in Phobos or elsewhere if this proposal is implemented triggers my gag reflex. There's got to be a better way than tacking yet another pre-ambulatory clause to the function body.

Reply via email to