There seem to be two schools of thought in the literature I’ve read. Some people resist in calling methods functions, other authors do it freely. We are lacking a word to describe something that syntactically looks like a function, acts like a function, walks like a function, and quacks like a function. For example method, anonymous function, object with an apply method, partial function, object inheriting from Function
. What should we call something that can be applied to arguments to obtain a result?
The point of my question 4 was that to me (the reader of the blog) it was confusing that one definition of show
makes a function-like-entity which when called with one argument returns a String
, and another show
which when called with one argument returns a function-like-entity which when called returns a String
, which is what the syntax def f(...)(...):String = {...}
does.