summaryrefslogtreecommitdiff
path: root/clojure
diff options
context:
space:
mode:
authorGuillermo Ramos2012-05-12 22:00:56 +0200
committerGuillermo Ramos2012-05-12 22:00:56 +0200
commit7db37912ec5762afd3ad67c68111e428f518bed0 (patch)
tree1d9850715dfa8d85eaa141cbaff6095ace6923be /clojure
parent9c9e91e845eb07fda6563c83df3dad5e58b1ef85 (diff)
download7l-7db37912ec5762afd3ad67c68111e428f518bed0.tar.gz
[Clojure] Día 1
Diffstat (limited to 'clojure')
-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}))