What tools are there for functional programming in C?

后端 未结 13 837
长情又很酷
长情又很酷 2021-01-29 17:18

I\'ve been thinking a lot lately about how to go about doing functional programming in C (not C++). Obviously, C is a procedural language and doesn\'t really support f

13条回答
  •  故里飘歌
    2021-01-29 17:50

    Well quite a few programming languages are written in C. And some of them support functions as first class citizens, languages in that area are ecl (embbedabble common lisp IIRC), Gnu Smalltalk (gst) (Smalltalk has blocks), then there are libraries for "closures" e.g in glib2 http://library.gnome.org/devel/gobject/unstable/chapter-signal.html#closure which at least got near functional programming. So maybe using some of those implementations to do functional programming may be an option.

    Well or you can go learning Ocaml, Haskell, Mozart/Oz or the like ;-)

    Regards

提交回复
热议问题