summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clojure/big.clj5
-rw-r--r--clojure/collection-type.clj8
2 files changed, 13 insertions, 0 deletions
diff --git a/clojure/big.clj b/clojure/big.clj
new file mode 100644
index 0000000..45fbd85
--- /dev/null
+++ b/clojure/big.clj
@@ -0,0 +1,5 @@
+(defn big [st n] (> (count st) n))
+
+(println (big "waka" 3))
+(println (big "waa" 3))
+(println (big "waka" 4))
diff --git a/clojure/collection-type.clj b/clojure/collection-type.clj
new file mode 100644
index 0000000..2bce856
--- /dev/null
+++ b/clojure/collection-type.clj
@@ -0,0 +1,8 @@
+(let [typeof {(type '(1)) :list
+ (type []) :vector
+ (type {}) :map}]
+ (defn collection-type [col] (typeof (type col))))
+
+(println (collection-type '(1 2 3)))
+(println (collection-type [1 2 3]))
+(println (collection-type {1 2, 3 4}))