From 7db37912ec5762afd3ad67c68111e428f518bed0 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Sat, 12 May 2012 22:00:56 +0200 Subject: [Clojure] Día 1 --- clojure/big.clj | 5 +++++ clojure/collection-type.clj | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 clojure/big.clj create mode 100644 clojure/collection-type.clj (limited to 'clojure') 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})) -- cgit v1.2.3