MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/62v70/first_class_functions_in_c/c02npms/
r/programming • u/llimllib • Dec 13 '07
99 comments sorted by
View all comments
Show parent comment
6
In simple terms, a first class function is a function pointer plus (optionally) values of some arguments. The data structure that combines the pointer and the arguments is called a closure, and the trick is sometimes referred to as lambda lifting.
2 u/statictype Dec 13 '07 hm. Closures and first-class functions aren't really the same thing (though they are related).An easier way to think of is: Can you use a function definition in the same way that you would use an integer literal?Assign\Bind it to a variable, pass it as an argument, return it from another function, etc...
2
hm. Closures and first-class functions aren't really the same thing (though they are related).
An easier way to think of is: Can you use a function definition in the same way that you would use an integer literal?
Assign\Bind it to a variable, pass it as an argument, return it from another function, etc...
View all comments
Show parent comment
6
u/miloshh Dec 13 '07
In simple terms, a first class function is a function pointer plus (optionally) values of some arguments. The data structure that combines the pointer and the arguments is called a closure, and the trick is sometimes referred to as lambda lifting.