On Saturday, 27 June 2015 at 11:11:31 UTC, Etienne Cimon wrote:
On 2015-06-27 01:06, thedeemon wrote:
Inference of return type was in ML since 1973. Such bleeding,
so edge. ;)
Is there some other natively compiled language that implemented
the auto keyword before? Or are you only talking about the
theory?
ML, SML, OCaml, Haskell, Idris - all of them natively compiled,
all can infer return types as well as virtually all the other
types.
They don't use "auto" keyword, of course, the syntax is
different. You just write
let f x y = x + String.length y
and OCaml (in this case) compiler knows that x is int, y is
string and return type is int.