I have some values repeated in my project.clj
like below:
(defproject foo "0.1.0-SNAPSHOT"
...
:dependencies [[bar "3.4.5"]
[baz "3.4.5"]
[bat "3.4.5"]]
...)
I would like to use some sort of constant here so, when these libraries get updated to 3.5.0
for example, I have to change just one place.
What is the best practise here? Best I can come up with is this:
(def deps-version "3.4.5")
(defproject foo "0.1.0-SNAPSHOT"
...
:dependencies [[bar ~deps-version]
[baz ~deps-version]
[bat ~deps-version]]
...)
~
char in your example, i.e.[bar ~deps-version]
. Your own solution is something I've used outside of leiningen (in gradle for selenium driver versions) so there's only one change to make, and fits well enough. – Bushire#=(eval (...))
and read constants from a file. (Which is perhaps not too absurd since you can make this file a resource and read it within the app too.) Feel free to edit the question BTW, the gist ishow to define constants
. – Suckerfish