3 ms·
By duck typing, I mean that you can write: f(x) = x^2 + 2 for example, and the function will happily run with any type that supports multiply and add. Thi
by one-more-minute 10y ago
By duck typing, I mean that you can write:
f(x) = x^2 + 2
for example, and the function will happily run with any type that supports multiply and add. This is in contrast to languages where `x` has to explicitly inherit from a given supertype or implement an interface to be valid. It's true that Julia will specialise the function for ints or complex numbers or whatever, but that's an implementation detail which doesn't change the meaning of the program.