Created
February 7, 2013 22:41
-
-
Save arohner/4734884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn resolve-map-fn | |
"given a record type, resolve and return it's map->Foo fn" | |
[record-class] | |
(let [simple-name (.getSimpleName record-class) | |
full-name (.getName record-class) | |
[_ the-ns] (re-find (re (<< "(.*)\\.~{simple-name}")) full-name)] | |
(when the-ns | |
(ns-resolve (find-ns (symbol the-ns)) (symbol (<< "map->~{simple-name}")))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment