Члены типа

Классы

; в Clojure нет статических членов: значения и функции хранит пространство имён

; константа типа
(def max-connections 3)

; type "fields"
(def host (atom "10.0.0.1"))
(def port (atom 0))

; type "method"
(defn get-connection [] (str @host ":" @port))

(reset! port 52)
(println (get-connection))  ; 10.0.0.1:52

(reset! host "10.0.0.3")
(println (get-connection))  ; 10.0.0.3:52
(println max-connections)