/match-set-and-get

convenience macros for messing with Clojure type definitions.

Primary LanguageClojureApache License 2.0Apache-2.0

match-set-and-get

Clojars Project

Convenience macros for messing with Clojure type definitions.

Usage

Currently there's only one macro here called with-setters. with-setters will create a protocol and reify it per mutable field in the type definition.

(with-setters
  (deftype Thinger [^:unsynchronized-mutable thing immutable-thing]))

(def t (->Thinger "hi" "there"))

(set-thing t "bye")