Created
April 7, 2015 08:07
-
-
Save yurrriq/b0dc479fe3adcda7e0d2 to your computer and use it in GitHub Desktop.
empty.clj
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
| ;; I forget about this function too often, so now it's a gist! | |
| (empty '(1 2 3)) ; <= () | |
| (type *1) ; <= clojure.lang.PersistentList$EmptyList | |
| (empty (range 1 3)) ; <= () | |
| (type *1) ; <= clojure.lang.PersistentList$EmptyList | |
| (empty [1 2 3]) ; <= [] | |
| (type *1) ; <= clojure.lang.PersistentVector | |
| (empty {:abc 123}) ; <= {} | |
| (type *1) ; <= clojure.lang.PersistentArrayMap | |
| (empty (sorted-map :a 1)) ; <= {} | |
| (type *1) ; <= clojure.lang.PersistentTreeMap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment