Please sign in to comment.
:require matching ns when importing classes created by deftype
Classes created by deftype and defrecord are created on ns evaluation, therefore that ns must be required before referencing these classes. deftype and defrecord classes implement IType and IRecord in Clojure 1.3.0+, so we can check the hierarchy to identify them. There is unfortunately no straightforward mapping of class package names to Clojure namespaces as deftype uses clojure.core/namespace-munge to simply change all \- to \_. Therefore a two step search for the matching ns is made: 1. Try the simple case where all underscores are converted to dashes 2. Search for the first namespace that matches the package name with dashes and/or underscores. Closes #64
- Loading branch information...
Showing with 40 additions and 3 deletions.