5

I am using emacs and swank-clojure. How do I resolve the below scenario -

  1. I have added a new dependency to project.clj.
  2. I run lein deps in a shell to get the new dep.
  3. I have an existing slime session that is open and want to use a function from the new dep.

How do I get the existing slime session to load the new dependency ?

Thanks, Murtaza

murtaza52
  • 46,887
  • 28
  • 84
  • 120

1 Answers1

6

You should have a look at pomegranate which is designed to provide similar if not identical capabilities as the one you describe.

As pointed out by @gergek in the comments, leiningen2 ships with pomegranate, so that if you're on lein2 you have to just fire something like the following in the slime REPL:

(require '[cemerick.pomegranate :as p])
(p/add-dependencies :coordinates '[[org.clojure/core.logic "0.7.5"]])

Have a look at add-dependencies docs for more info on how to use it.

Community
  • 1
  • 1
skuro
  • 13,414
  • 1
  • 48
  • 67
  • 1
    According to its readme "Pomegranate is being used by Leiningen v2.x as its sole dependency resolution library". If murtaza52 upgrades to lein 2 he should be most of the way there? – georgek Jul 04 '12 at 15:21
  • 1
    Somehow this does not work on my lein 2.5, I get this after entering the first line in a repl: FileNotFoundException Could not locate cemerick/pomegranate__init.class or cemerick/pomegranate.clj on classpath. clojure.lang.RT.load (RT.java:449) – Anton Harald Feb 13 '16 at 16:30