I wish to use permutation and combinations on a list, it turns out clojure.core has nothing to offer in the way.
thus i need to use clojure/math.combinatorics, which can be added as a leiningen dependency so that one could do this :
(comb/combination [1 2 3 4 5] 2)
how does one get these dependencies without starting a leiningen project and on a simple clojure repl ?
If you’re a lein fan, there’s always the lein-try plug-in. It doesn’t require a project, but you would have to install the plug-in in your ~/.lein/profiles.clj.
If you’re a boot fan, you can do it directly on the command-line: boot -d org.clojure/math.combinatorics:0.1.4 repl (or, if you don’t care about the specific version, you can just leave it off and boot will automatically grab the latest: boot -d org.clojure/math.combinatorics repl).
Lately I’ve started adding a add-dependency helper based on Pomegranate to user.clj in my projects, so it’s easy to load an extra dependency to try out without restarting your REPL. You could make this available to any lein repl by adding it to your ~/.lein/profiles.clj.