prosseek
prosseek

Reputation: 190809

Is conjure-contrib.jar not standardized now?

This page introduces a lot of clojure libraries. And this page also comments to consider using the clojure-contrib.

Added

After updating leiningen, I checked that (use 'clojure.contrib.str-utils) works fine. But, (use 'clojure.contrib.repl-utils) gives me the following error.

  [Thrown class java.lang.IllegalStateException]

Restarts:
 0: [QUIT] Quit to the SLIME top level

Backtrace:
  0: clojure.lang.Namespace.warnOrFailOnReplace(Namespace.java:88)
  1: clojure.lang.Namespace.reference(Namespace.java:110)
  2: clojure.lang.Namespace.refer(Namespace.java:168)
  3: clojure.core$refer.doInvoke(core.clj:3288)
  4: clojure.lang.RestFn.invoke(RestFn.java:411)
  5: clojure.lang.AFn.applyToHelper(AFn.java:163)
  6: clojure.lang.RestFn.applyTo(RestFn.java:133)
  7: clojure.core$apply.invoke(core.clj:542)
  8: clojure.core$load_lib.doInvoke(core.clj:4781)
  9: clojure.lang.RestFn.applyTo(RestFn.java:143)
 --more--

(require 'clojure.contrib.repl-utils) work, and I can use (clojure.contrib.repl-utils/show #{}), but (refer 'clojure.contrib.repl-utils) gives me an error.

And here are some more question.

Upvotes: 3

Views: 577

Answers (2)

nickik
nickik

Reputation: 5881

  1. A lot of functions in clojure-contrib moved into clojure core in Clojure 1.2. The diffrence between now and 1.1 is about the same as the growth of clojure.core.

  2. get the leiningen update

  3. don't know I just use leiningen

  4. Just add it to your project.clj in leinigen

Upvotes: 1

Rob Lachlan
Rob Lachlan

Reputation: 14459

I'm not sure what you mean by standardized, but contrib doesn't make backwards breaking changes without good reason. Some things are occasionally moved to core, if they're sufficiently important -- I seem to recall sequence functions doing that, and likely the string functions that you're thinking of.

Re: Leiningen: a new version just came out. In any case, it sounds like you might have a version conflict.

Regarding the classpath: the source of many unpleasant problems until you get used to it (or it was for me). It could be either of the things you mention, given the context, we're almost certainly talking about clojure-contrib.jar.

To download etc. there are various methods. The easiest method, in virtually all cases, is to list them as a dependency in the project.clj file for your project. In other words, use leiningen. You can also download them from clojars. Or you can clone their github repos, and compile them individually, and copy them into the lib directory of your project. But seriously, just use leiningen.

Upvotes: 2

Related Questions