Created
June 20, 2014 12:13
-
-
Save schmir/f7a75f1167ecfad51c2d to your computer and use it in GitHub Desktop.
Revisions
-
schmir created this gist
Jun 20, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ (in-ns 'clojure.core) ;; make reloading namespaces work with proxy! (defn proxy-name** {:tag String} [^Class super interfaces] (let [inames (into1 (sorted-set) (map #(.getName ^Class %) interfaces)) ihashes (into1 (sorted-set) (map #(System/identityHashCode %) interfaces))] (apply str (.replace (str *ns*) \- \_) ".proxy" (interleave (repeat "$") (concat [(.getName super)] (map #(subs % (inc (.lastIndexOf ^String % "."))) inames) [(Integer/toHexString (hash ihashes))]))))) (defn proxy-name {:tag String} [^Class super interfaces] (let [r (proxy-name** super interfaces)] (println "using patched proxy-name" [super interfaces] r) r))