Skip to content

Instantly share code, notes, and snippets.

@srid
Created September 19, 2011 03:21
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 srid/1225913 to your computer and use it in GitHub Desktop.
Save srid/1225913 to your computer and use it in GitHub Desktop.
;; amalloy's solution to http://4clojure.com/problem/60
(fn r
([f [x & coll]] (r f x coll))
([f acc coll]
(lazy-seq
(if-let [[x & coll] (seq coll)]
(cons acc
(r f (f acc x) coll))
[acc]))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment