Assuming the Java or Clojure library is on your classpath, it *should* be
usable from the REPL.

(import '[java.library SomeClass])

(.foo (SomeClass. 42))

(require '[clojure.contrib.math :as m])

(m/sqrt 42.0)

or whatever



On Thu, Nov 7, 2013 at 8:00 AM, Starry SHI <starr...@gmail.com> wrote:

> Hi. I am new to clojure, and I find leiningen REPL is a convenient tool
> for clojure code testing. However, I find I cannot include external java
> libraries and call functions defined in those libraries from lein REPL.
>
> For example, my clojure code needs to compute square root, which is
> defined in clojure-contrib (clojure.contrib.math). I don't know how to
> include clojure-contrib jar file into lein REPL, such that I can call sqrt
> functions from my own clojure code.
>
> Can anyone share your experience on how to do it?
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to