What tools are there for functional programming in C?
FFCALL lets you build closures in C — callback = alloc_callback(&function, data) returns a function pointer such that callback(arg1, …) is equivalent to calling function(data, arg1, …). You will have to handle garbage collection manually, though. Relatedly, blocks have been added to Apple’s fork of GCC; they’re not function pointers, but they let you pass around lambdas while avoiding the need to build … Read more