Re:Functional PHP 5.3 - What are Anonymous Functions and Clo...
by alexfarran on Tuesday August 18, 2009 @12:06PM
(#770736)
Not much. The other difference is that closures can access the local variables that are in scope at the point where the function is defined. I guess you could hack this together in C by packing and unpacking the variables into a struct together with the function pointer. It's a bit long winded that way though.
In smalltalk and ruby closures are used extensively to define new control structures using the block syntax.
In smalltalk and ruby closures are used extensively to define new control structures using the block syntax.