A symbol followed by ()
usually means that the symbol is a function name. However,
it could be an object whose type implements invoke()
. Whatever parameters are
in the parentheses get passed as parameters to invoke()
.
Here, we have the same algorithm that we used with the div()
function, but
this time the function is invoke()
instead of div()
. We can now "call a function"
directly on a String
and pass an Int
parameter.
You can learn more about this in:
Tags: