Instantly share code, notes, and snippets.

Embed
What would you like to do?
package leak;
import clojure.lang.IFn;
import clojure.lang.RT;
import clojure.lang.Symbol;
public class Klass {
static {
RT.var("clojure.core", "require").invoke(Symbol.intern("leak.leaky"));
}
public static IFn foo = RT.var("leak.leaky", "foo");
}
(ns leak.leaky)
(defn foo
"Some doc"
[]
"hello")
(def unrelated 42)
(ns leak.main)
(defn first-to-load []
leak.Klass/foo)
(defn second-to-load []
leak.Klass/foo)
(comment
=> (map (comp count #(.getFields %) class) [first-to-load second-to-load])
(16 1)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment