泛型类型

;; Clojure has no generics at all, because it has no static types:
;; a function accepts whatever it is handed, so there is nothing
;; to parameterize. One map serves every kind of size

(defn size [width height] {:width width, :height height})

(defn as-text [s] (str "[" (:width s) "; " (:height s) "]"))

(def text-int (as-text (size 5 8)))
;; text-int is "[5; 8]"

(def text-float (as-text (size 3.7 1.58)))
;; text-float is "[3.7; 1.58]"

(println "text-int is" text-int)
(println "text-float is" text-float)
(println "text-mixed is" (as-text (size "wide" :tall)))