Hacker News new | ask | show | jobs
by eridius 3499 days ago
That's not a function, that's a closure. And you can simulate that in C by creating a struct that contains the function pointer and the set of captured data (and then when you invoke the function you pass the struct to it as a parameter).
1 comments

Yes, hence the distinction between first-class features and others, which you have to implement yourself.
The parent comment said C function pointers aren't functions. They are. They just aren't closures.