3 ms·
If you know Python / Ruby / Lisp, you might know it by the name ‘lambda’, or if you come from a JavaScript background, you might’ve used it under the name ‘anon
by wglb 15y ago
If you know Python / Ruby / Lisp, you might know it by the name ‘lambda’, or if you come from a JavaScript background, you might’ve used it under the name ‘anonymous function’.
This is false. Lambdas capture context; pointed-to functions i C do not.
- jasonlotito 15y agoFTA: The point was not to go into the nuances of closures and lambdas, but only to highlight the basic similarity between function pointers / lambdas / anonymous functions.
- jacquesm 15y agoI believe it is closures that capture context, lambdas are just anonymous functions, see: http://en.wikipedia.org/wiki/Anonymous_function http://en.wikipedia.org/wiki/Anonymous_function vs http://en.wikipedia.org/wiki/Closure_%28computer_science%29 http://en.wikipedia.org/wiki/Closure_%28computer_science%29 A lambda function with all its variables bound is a closure iirc.