Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created January 10, 2020 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borkdude/82b711183e64e6f88dfc15a93eaadc98 to your computer and use it in GitHub Desktop.
Save borkdude/82b711183e64e6f88dfc15a93eaadc98 to your computer and use it in GitHub Desktop.
Clojure loading order
(require '[clojure.java.shell :refer [sh]]
'[clojure.string :as str]
'[clojure.edn :as edn])
(def res (sh "clojure" "-e" "(binding [clojure.core/*loading-verbosely* true] (require '[babashka.main]))"))
(def lines (as-> res $
(:out $)
(str/split $ #"\n")
(filter #(re-find #"clojure.core/load" %) $)
(map edn/read-string $)
(map second $)
(reverse $)))
(prn lines)
;; output
;; ("/sci/addons" "/babashka/wait" "/clojure/tools/cli" "/babashka/impl/tools/cli" "/babashka/impl/clojure/core/server" ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment