title: What is the easiest way to load a clojure library all the time?
body: <p>A question from an utter newcomer to clojure:  What if I want to be able to start a clojure REPL from anywhere, for example because I just want to compute an exponent?  How can I set up my system to do this?  (I've deleted earlier links to not-quite-answers because they were cluttering up the question.) The Pomegranate documentation linked by @Jared314's answer below helped me see that I can do this:</p>
  
  <pre><code>~$ lein repl
  ...
  user=&gt; (use '[cemerick.pomegranate :only (add-dependencies)])
  nil
  user=&gt; (add-dependencies :coordinates '[[org.clojure/math.numeric-tower "0.0.2"]])
  {[org.clojure/clojure "1.3.0"] nil, [org.clojure/math.numeric-tower "0.0.2"] #{[org.clojure/clojure "1.3.0"]}}
  user=&gt; (use 'clojure.math.numeric-tower)
  nil
  user=&gt; (expt 2 3)
  8
  </code></pre>
  
  <p>Yay!</p>
  
  <p>Now how can I make this happen every time I start the REPL, no matter what subdirectory I'm in?</p>
  
  <p>I think I'm just ignorant of basic clojure setup.  Sorry about that.</p>
  
  <p>Second major edit:</p>
  
  <p>I've figured out that if I use raw clojure without lein, I can execute commands on startup of the repl.  For example, if the file <code>.clojurerc</code> contains the text <code>(print "Yow!\n")</code>, I can do this:</p>
  
  <pre><code>~$ java -cp /usr/local/lib/clojure-1.5.1/clojure-1.5.1.jar clojure.main -i .clojurerc -r
  Clojure 1.5.1
  Yow!
  user=&gt; 
  </code></pre>
  
  <p>Can I do something like this with <code>lein</code>?  Or maybe better yet, load clojure.math.numeric-tower automatically in clojure without using lein (since for simple command line experimentation, lein's startup is slower than starting clojure directly).</p>
  
  <p>(It may seem as if I'm not trying to solve this on my own, but I that's not so.  I have been doing web searches and experimenting, but I keep hitting brick walls. I'm starting to feel as if clojure is <em>only</em> intended for full-blown programming projects.  I had assumed that it could be good for add-hoc experiments and calculations (as lisps traditionally are but Java is not).  I'm not trying to incite arguments.  I'm just frustrated.  There ought to be a simple, well-known formula for doing what I'm trying to do.)</p>