Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
2. Do It, Do It Again, and Again, and Again ...
(defn atom? [x]
(not (seq? x)))
(defn lat? [x]
(loop [l x]
(cond
(empty? l) true
(atom? (first l)) (recur (last l))
:else false)))
(defn member? [atom lat]
(loop [a atom l lat]
(cond
(empty? l) false
:else (or (= (first l) a)
(recur a (rest l))))))
@soofaloofa-zz

This comment has been minimized.

Copy link
Owner Author

soofaloofa-zz commented Jun 14, 2011

Clojure functions for Chapter 2 of The Little Schemer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.