I’m trying to understand how
user.clj files are loaded by clojure.
For example, using clojure CLI, if I have a
user.clj file in one of my dependencies, that
user.clj file is loaded by clojure, but if add a
user.clj in my paths, looks like my
user.clj file is loaded instead, and the one in the dependencies it’s not loaded anymore. Not sure if my assumptions are correct, but it looks like the last
user.clj wins and the other are discarded.
If it is possible to load multiple
user.clj files, I think it would be nice to have a global
user.clj file (used only by me), where I can define, for example, a custom pretty-print function, but also to have a
user.clj file in every project, where I can define some specific helpers for the project. I guess with leiningen injections it’s possible to accomplish something similar, but I’m trying to do it using only clojure CLI.
BTW, to load a global
user.clj I found this project: https://github.com/gfredericks/user.clj