Created
August 8, 2012 11:21
-
-
Save devnoo/3294349 to your computer and use it in GitHub Desktop.
seven languages in seven weeks clojure day 1
This file contains hidden or 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
(defn big [str,n] (> (count str) n)) |
This file contains hidden or 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
(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