Tue Oct 7 09:57:29 CEST 2008
When explaining functional programming to somebody with a hands-on
imperative/oo background (say C,C++,Python), how to proceed?
I think the punch-lineshould be something like: closures (lambda)
make the creation of plug-in behaviour really easy. A closure is
essentially a method bound to a hidden object.
Except from typing "lambda" in Scheme, or "fun" in Ocaml or "\" in
Haskell, there is essentially no overhead when creating these objects.
These objects are first-class, in that they can be passed to other
such objects as function arguments.
Essentially, functional programming is about "building functionality
by passing closures (parameterized behaviour with context) to other