Skip to content

Instantly share code, notes, and snippets.

@devnoo
Created August 8, 2012 11:21
Show Gist options
  • Save devnoo/3294349 to your computer and use it in GitHub Desktop.
Save devnoo/3294349 to your computer and use it in GitHub Desktop.
seven languages in seven weeks clojure day 1
(defn big [str,n] (> (count str) n))
(defn collection-type [col] "what kind of collection is col" (if (list? col) :list (if (set? col) :set (if (map? col) :map))))
user=> (collection-type (sorted-set 1 2))
:set
user=> (collection-type (list 1 2))
:list
user=> (collection-type (str "1" ))
nil
user=> (collection-type (sorted-map 1 :one ))
:map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment