Created
January 15, 2015 16:36
-
-
Save kindlychung/e4b5e4fb226449bad83c to your computer and use it in GitHub Desktop.
This file contains 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
(defn comp1 | |
([] | |
;; No functions provided, return identity | |
identity | |
) | |
([f] | |
;; A single function provided, return itself | |
f | |
) | |
([& fs g] | |
;; Two functions provided | |
(apply recur | |
(conj (pop fs) (fn [& args] ((last fs) (apply g args)))) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment