Skip to content

Instantly share code, notes, and snippets.

@Madsy
Created April 28, 2012 08:46
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 Madsy/2517259 to your computer and use it in GitHub Desktop.
Save Madsy/2517259 to your computer and use it in GitHub Desktop.
(defn my-count
([] 0)
([x] (if (nil? x) 0
(cond (coll? x) (apply my-count 0 x)
(string? x) (apply my-count 0 x))
))
([counter & args]
(if (nil? (first args))
counter
(recur (inc counter)
(next args))))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment