Clojure’s go-to “record” type: persistent maps with keyword keys, fast lookup, and immutable assoc/update/merge operations.
Maps are the default “domain object” in most Clojure codebases. If you’re coming from Java, think: a map often replaces a POJO + getters/setters—except updates are immutable and explicit.
1{:user/id 42
2 :user/name "Ada"
3 :user/active? true}
Keyword keys are a common convention because they are lightweight, immutable, and readable.
1(def user {:user/id 42 :user/name "Ada"})
2
3(get user :user/name) ; => "Ada"
4(:user/name user) ; => "Ada" ; keyword-as-function lookup
5(user :user/id) ; => 42 ; maps are also callable by key
1(assoc user :user/active? true)
2(update user :user/id inc)
3(dissoc user :user/name)
Merge maps (rightmost wins on key collisions):
1(merge {:a 1} {:a 2 :b 3})
2;; => {:a 2, :b 3}
1(get-in {:a {:b 1}} [:a :b]) ; => 1
2(assoc-in {} [:a :b] 1) ; => {:a {:b 1}}
3(update-in {:a {:b 1}} [:a :b] + 10) ; => {:a {:b 11}}