Created
February 7, 2012 01:58
-
-
Save micrypt/1756593 to your computer and use it in GitHub Desktop.
SICP Clojure notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Iterative count | |
(defn count [sent] | |
(defn iter [wds result] | |
(if (empty? wds) | |
result | |
(iter (rest wds) (+ 1 result)))) | |
(iter sent 0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment