Skip to content

Instantly share code, notes, and snippets.

@kindlychung
Created January 15, 2015 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kindlychung/e4b5e4fb226449bad83c to your computer and use it in GitHub Desktop.
Save kindlychung/e4b5e4fb226449bad83c to your computer and use it in GitHub Desktop.
(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