|XP is just a number|
Re^2: Real life uses for closures.by LanX (Chancellor)
|on Feb 12, 2013 at 11:40 UTC||Need Help??|
> However, in a real world app one needs to create callbacks on the fly, without knowing beforehand what exacly they whould do. And closures rock.
Good points, I agree with you about the use cases!
Just your definition of closures seems to be reduced to just generating anonymous functions.
That's not the point, the main characteristic of closures is accessing variables from the outer scope at definition/generation time, most efficiently even shared between multiple closure-functions.
So a real-world example should include shared private variables.