by pjakma · 13y ago · 0 comments
Also, the language may, if it provides some sugar to allow the anonymous function to appear to return to the caller, e.g. through async/yield/co-routine type semantics, also transparently copy back the variables to the callers' locations.
As per another commentator, 'lambdas', 'closures' and 'anonymous functions' are used equivalently by different people and/or fields.
As a C programmer primarily, I was long confused why higher-level programmers went on about "closures". They're nothing special, we do this kind of stuff in C all the time. We have to do it by hand ourselves, the language doesn't give us shortcuts. It's not really mysterious and we don't have fancy names for it. Sometimes I wonder if the reason some higher-level programmers treat these things so reverentially is, perhaps, because there is an element of mysticism to it, borne of lack of understanding of what is happening "under the hood"?
No comments yet.