Created
February 21, 2015 02:01
-
-
Save bmorphism/8031ea32b9b323386ee9 to your computer and use it in GitHub Desktop.
My solution to 4Clojure problem 60
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
(fn fun-times | |
([fun xs] (fun-times fun (first xs) (rest xs))) | |
([fun init xs] (lazy-seq | |
(if (seq xs) | |
(let [reduction (fun init (first xs))] | |
(cons init (fun-times fun reduction (rest xs)))) | |
[init] | |
)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment