Skip to content

Instantly share code, notes, and snippets.

@bmabey
Created October 16, 2010 04:14
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 bmabey/629404 to your computer and use it in GitHub Desktop.
Save bmabey/629404 to your computer and use it in GitHub Desktop.
(defn map-tree [f x]
(if (coll? x)
(if (empty? x)
x
(cons (map-tree f (first x)) (map-tree f (rest x))))
(f x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment