hello, 2010/6/22 Brent Millare <brent.mill...@gmail.com>: > user=> (in-ns 'protocol.test) > #<Namespace protocol.test> > protocol.test=> (defrecord person [name age]) > protocol.test.person > protocol.test=> (person. "bobby" 23) > #:protocol.test.person{:name "bobby", :age 23} > protocol.test=> (in-ns 'user) > #<Namespace user> > user=> (protocol.test/person. "alice" 2) > java.lang.IllegalArgumentException: Unable to resolve classname: > person (NO_SOURCE_FILE:45) > > Using 1.2 Snapshot: > commit d694d6d45fb46195ae4de01aab9a2b9f9c06355f > Date: Thu May 27 23:00:45 2010 -0400 > > I was expecting defrecord to define a class in the protocol.test > namespace and should thus be accessible in another namespace with a > fully qualified symbol but instead got an error. Is this the defined > behavior?
No. defrecord defines a class whose simple name matches the name of the record, and whose package matches *ns* (with the usual - to _ conversion). So while in another namespace, try (protocol.test.person. "alice" 2) instead of (protocol.test/person. "alice" 2). There's no such thing as a "class defined in a namespace". Classes are java constructs, not clojure's. HTH, -- Laurent -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en