Getting the name of a Clojure struct type?
- by j-g-faustus
When defining a struct type and instance, I can print the value and get the "struct" implementation type:
(defstruct person :name :age)
(def p (struct person "peter" 30))
user=> p
{:name "peter", :age 30}
user=> (type p)
clojure.lang.PersistentStructMap
But is it possible to tell whether p is an instance of the struct type "person"?