On Tue, 11 Nov 2008 00:38:45 -0800, Peter <xd****@hotmail.comwrote:
[...]
If "anonymous method" is just a synonym for "closure" then fine - but
it sure confuses things when you're trying to get to grips with these
concepts.
"Closure" is a language feature. An anonymous method is a way to
implement that feature, as are lambda expressions. "Anonymous method"
definitely is not a synonym for "closure".
At least based on the Wikipedia definition, an anonymous method wouldn't
be a closure unless it actually did capture a variable. But for me
personally, that distinction seems kind of silly. It's like saying that a
named method without any literal references to external variables isn't
actually a method, or a for() or while() loop that only ever executes once
isn't actually a loop.
To me, an anonymous method that doesn't capture outer variables may be a
degenerate closure, but it's still a closure. :) YMMV. And even with
that interpretation, that doesn't make the phrase "anonymous method"
synonymous with "closure".
Pete