3 ms·
If an anonymous function can capture state from the enclosing code block, and outlive that code block, then it's a lambda. So this probably isn't really a lamb
by StrawberryFrog 15y ago
If an anonymous function can capture state from the enclosing code block, and outlive that code block, then it's a lambda.
So this probably isn't really a lambda.
- philwelch 15y agoThat's the definition of a closure. I'm not sure if "lambda" is necessarily synonymous with "closure" or just synonymous with "anonymous function", but lambdas are closures in many languages.
- StrawberryFrog 15y agoYou're right, my terms are sloppy. Are there rigorous definitions, or does it vary between languages?. I think of "lambda" as a language construct that creates closures. "anonymous functions" are of course just a simpler subset of closures.