On Sun, Mar 30, 2008 at 11:53:22AM -0700, Christopher Smith wrote:
Closures are somewhat useful, at least if the language has garbage collection.
I find that an odd statement. You can use functors as closures already in C++ (C++0X just avoids it being so syntactically cumbersome), and I've done this a fair bit for at least 5 years. While aspects of C++ have, as always, proven to be annoying when doing this, memory management never really cropped up as a particular problem with functors. Can you give an example of how explicit memory management limits the usefulness of closures?
When closures become syntactical, the allocation becomes implicit. Implicit allocation with explicit deallocation is very hard to get right. But again, nearly everything in C++ is hard to get right, it seems to be a design constraint on the language. David -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
