Why don\'t more mainstream statically typed languages support function/method overloading by return type? I can\'t think of any that do. It seems no less useful or reasona
For the record, Octave allows different outcome according to return element being scalar vs array.
x = min ([1, 3, 0, 2, 0]) ⇒ x = 0 [x, ix] = min ([1, 3, 0, 2, 0]) ⇒ x = 0 ix = 3 (item index)
Cf also Singular Value Decomposition.