News for hackers. Stuff that matters.
Re:Swift and the Legacy of Functional Programming by lanna on Monday November 21, 2016 @12:20PM (#13007060)
No, wrong. You can pass pointers to functions in C.
Re:Swift and the Legacy of Functional Programming by Someone on Monday November 21, 2016 @01:45PM (#13007941)
It is a bit snarky, but also has a ground truth: pointers to functions aren't functions.

More importantly, you cannot make functions in C. For example, one cannot write a function that, given pointers to functions that compute 1/x and sin(x), returns a pointer to a function that returns 1/sin(x)

Re:Swift and the Legacy of Functional Programming by eridius on Monday November 21, 2016 @01:58PM (#13008066)
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).
Re:Swift and the Legacy of Functional Programming by junke on Monday November 21, 2016 @02:19PM (#13008262)
Yes, hence the distinction between first-class features and others, which you have to implement yourself.
Re:Swift and the Legacy of Functional Programming by eridius on Monday November 21, 2016 @04:12PM (#13009260)
The parent comment said C function pointers aren't functions. They are. They just aren't closures.