(defmacro create-func [func-name attr] `(defn ~func-name [person] (~attr person)))
(create-func c-age :age)
When you write this, it will expand to
(defn c-age [user/person] (:age user/person))
Syntax error macroexpanding clojure.core/defn at (/tmp/form-init14482279258588584188.clj:1:1).
user/person - failed: vector? at: [:fn-tail :arity-n :bodies :params] spec: :clojure.core.specs.alpha/param-list
(user/person) - failed: Extra input at: [:fn-tail :arity-1 :params] spec: :clojure.core.specs.alpha/param-list
To avoid this, you should write
(defmacro create-func [func-name attr] `(defn ~func-name [person#] (~attr person#)))
or use another way to do not use qualified symbols in parameter name.
create macros for "getter" is a antipattern in clojure.
if you want to access a field, just access it.
also, def-macros usually can be written as a function
(def c-age (im-not-a-macro :age))