Skip to content

Instantly share code, notes, and snippets.

@lnostdal
Created January 20, 2016 13:41
Show Gist options
  • Save lnostdal/c38899f42d983a786049 to your computer and use it in GitHub Desktop.
Save lnostdal/c38899f42d983a786049 to your computer and use it in GitHub Desktop.
;;; Add this in your project.clj to enable direct linking
;;
;; :jvm-opts ["-Dclojure.compiler.direct-linking=true"]
;; ..and now observe how this changes things:
; CIDER 0.11.0snapshot (package: 20160119.836) (Java 9-ea, Clojure 1.9.0-master-SNAPSHOT, nREPL 0.2.12)
user> (defn a [] (println "a"))
#'user/a
user> (defn b [] (a) (println "b"))
#'user/b
user> (b)
a
b
nil
user> (defn a [] (println "a!"))
#'user/a
user> (b)
a
b
nil
;; I.e. B will still refer to the old version of A and you need to recompile B to make sure it sees the new version of A:
user> (defn b [] (a) (println "b"))
#'user/b
user> (b)
a!
b
nil
user>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment