Классы / Конструкторы

;; nothing is inherited, so there is no parent constructor to replace.
;; instead a second wrapper takes fewer arguments and fills the rest
(defrecord Employee [name position])

(defn make-employee [name position]
  (->Employee name position))

(defn make-newcomer [name]
  (make-employee name "unknown"))

(def employee (make-newcomer "Max"))
;; position is "unknown"

(println "name is" (:name employee))
(println "position is" (:position employee))