Talk:First-class functions: Difference between revisions

(→‎Even C could?: what a pity - :D)
Line 57:
 
Maybe this task is actually requiring [[wp:Closure (computer science)|closures]]? The concepts of first-class functions and closures are very inter-related and often confused. The ability to make a "compose" function requires closures, because the returned function needs to be able to remember ("close" around) the input functions when it is created so that it can use them to compute the correct result. When you talk about "creating" functions at run time, what you care about is the ability for it to close around run-time variables in scope at that time. Because if you couldn't do that, you would have what is morally equivalent to C function pointers, because they would be statically known at compile-time, and you could just "lift" them out of the functions that created them. --[[User:Spoon!|Spoon!]] 20:25, 24 February 2009 (UTC)
 
==Don't merge with functional composition==
functional composition is only part of the task. The idea is to show how well a language supports first-class functions with a task that needs more of the traits that the WP article says characterizes first class functions. --[[User:Paddy3118|Paddy3118]] 10:03, 28 March 2009 (UTC)
Anonymous user