3 ms·
I'm confused by your terminology here. Doesn't "callback" usually just mean a first class function f you pass around - as a piece of data - to another function
by lacampbell 9y ago
I'm confused by your terminology here. Doesn't "callback" usually just mean a first class function f you pass around - as a piece of data - to another function g, under the assumption that g calls f?
Ie
function f(...) {...}
g(f);
It looks like you're using "callback" to refer to "g" in my example, not "f". Is my terminology wrong, or is yours?
(This is a genuine terminology question, not an exercise in pedantry.)
- Animats 9y agoSorry, meant "callback argument", a function argument to which a function can be passed. In Javascript and Python, all functions passed as parameters to other functions are potentially closures, but this is not the case in most compiled languages.
- lacampbell 9y agoNo worries. The callback terminology always confused me. I think it came from the C culture, where you need a special word for a tricky concept. Weird that it persists in javascript, where it's easy.