I have clojure file with some predefined functions and records
;outer.clj
(ns outer )
(defn foo [a] (println a))
(defrecord M [id])
And now usage file
;inner.clj
(ns inner (:use outer ))
(foo 2) ;works fine
(println (:id (M. 4))) ;throws IllegalArgumentException: Unable to resolve classname: M
Why does function imports fine but records definition doesn’t? How I should import it?
Because defrecord generates a JVM class ‘under the covers’ you need to import that class…