by itsnotvalid · 15y ago · 0 comments
> The term closure is often mistakenly used to mean anonymous function. This is probably because most languages implementing anonymous functions allow them to form closures and programmers are usually introduced to both concepts at the same time. An anonymous function can be seen as a function literal, while a closure is a function value. These are, however, distinct concepts. A closure retains a reference to the environment at the time it was created (for example, to the current value of a local variable in the enclosing scope) while a generic anonymous function need not do this.http://news.ycombinator.com/item?id=2303548
A longer explanation:
>> a closure is a collection of closed-over variables retained by a function.
I don't really dig deep for what the constructs would produce in memory, but they should be some lambda expression.