Created
January 19, 2017 07:29
-
-
Save terry3/fff6921ba18dfbca9c470fd57610c651 to your computer and use it in GitHub Desktop.
n comp implementation in clojure
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
(defn n-comp | |
[& fs] | |
(fn [& args] | |
(reduce #(%2 %1) | |
(apply (last fs) args) | |
(rest (reverse fs))))) | |
((n-comp inc inc inc inc inc ) 1) ; output 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment