I was presented with something unfamiliar to me and really want to understand how and why this can be done:
Let's say we have a myfunc function, and it can be called in one of two ways and return the same value (say, just adding integers):
myfunc(1,2)
myfunc(1)(2)
I looked through everything and can not find examples of the second call. My understanding is that a function can return a function object (possibly defined as a closure or lambda?), Which is then passed as an argument?
source
share