Wednesday, January 1, 2014

Functional Programming for the Object-Oriented Programmer

Am reading "Functional Programming for the Object-Oriented Programmer" from Leanpub.com.

Trying to get a clojure repl going I find Jline has been improved to the point where it is useless so let's try lein's repl.

cd dev/src/clojure
lein new app fp4oo
cd fp4oo
lein repl
fp4oo.core=> (+ 4 5 ) <<ENTER>>
9
<<press up arrow>>
fp4oo.core=> (+ 4 5 ) <<ENTER>>
9
fp4oo.core=> ((fn [n] (+ n n ) ) 4)
8

It is nice to see that lein's repl does only what I ask of it.