title: What tools are there for functional programming in C?
body: <p>I've been thinking a lot lately about how to go about doing functional programming in C (<em>not</em> C++).  Obviously, C is a procedural language and doesn't really support functional programming natively.</p>
  
  <p>Are there any compiler/language extensions that add some functional programming constructs to the language?  GCC provides <a href="http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html" rel="noreferrer">nested functions</a> as a language extension; nested functions can access variables from the parent stack frame, but this is still a long way away from mature closures.</p>
  
  <p>For example, one thing that I think could be really useful in C is that anywhere where a function pointer is expected, you could be able to pass a lambda expression, creating a closure which decays into a function pointer.  C++0x is going to include lambda expressions (which I think is awesome); however, I'm looking for tools applicable to straight C.</p>
  
  <p>[Edit] To clarify, I'm not trying to solve a particular problem in C that would be more suited to functional programming; I'm merely curious about what tools are out there if I wanted to do so.</p>