Hi Jim,
Thanks so much! Using 'def' instead of 'defn' when defining a function
composed of functions was what I was missing.
I can't believe I spent an hour trying to figure this out -- it seems
very obvious now. Doh!
:)
On Nov 8, 6:50 pm, Jim Crossley wrote:
&
Hi All,
I'm working through Brian Harvey's 61a 2008 SICP lecture (http://
www.youtube.com/watch?v=ljOrUCqsixs) and could really use a hand
translating a couple of simple lines from scheme to clojure.
Here is the code:
1: (define (compose f g) (lambda (x) (f (g x
2: (define (twice f) (compo
Those are great links Linus, thank you.
Also highly relevant and beginner friendly is the text adventure game
chapter from the, "Land of Lisp" book, of
which a free clojure translation is available online:
http://www.lisperati.com/clojure-spels/casting.html
Cheers,
Joshua
On Oct 31, 6:01 pm
Thanks so much for your help!!! I'm so glad you had the time to
respond to my newbie question.
And as if you read my mind as I was going through the SICP lecture and
referencing chapter two in Manning's Joy of Clojure book I was
wondering how to turn this explicit recursive call taken from the
sch
Hi All,
I'm watching Brian Harvey's SICP lecture #3 from Berkeley 61A/Spring
2011 and had a question about how I could refactor the following
function so that the (+a 1) can be abstracted to be a function and
passed in.
Here is the original:
(defn square [x] (* x x))
(defn sum [fn a b]
(if (