Skip to content

Instantly share code, notes, and snippets.

@minikomi
Created January 20, 2012 06:38
Show Gist options
  • Save minikomi/1645793 to your computer and use it in GitHub Desktop.
Save minikomi/1645793 to your computer and use it in GitHub Desktop.
4Clojure Problem #60
(fn [f init & [args]]
(let [init-args (if (nil? args) init (cons init args))]
(map
#(reduce function (take % init-args))
(map #(inc %2) init-args (range)))))
@minikomi
Copy link
Author

For each step through, take x elements from initial arguments & reduce with function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment