3 ms·
This is a genuine question - does having a statically typed language make flip soup and argument ordering slightly less of an issue? If your types are well lab
by yomly 8y ago
This is a genuine question - does having a statically typed language make flip soup and argument ordering slightly less of an issue?
If your types are well labelled, can you push the complexity of your control flow and functional-glue (as I like to call it) into the compiler?
- phaedrus 8y agoIn the limit, if all of your types are well enough labelled, you wouldn't even need positional arguments - it could be inferred / would only have one answer. For example if (using C++ pseudo code) "double slope_of(double x, double y)" were instead "Slope slope_of(XCoord x, YCoord y)", the same function called with "slope_of(y, x)" could un-scramble those arguments. Just consider all permutations of the argument list as static overloads, and disallow having two parameters of the same type. If the language supports Currying, you could then Curry any argument of any position at any time, because the unique types guarantee the compiler knows which parameter is being bound.
- pyrale 8y agoTry this with (a - b).