Extensions and enhancements to the Clojure libraries.
Questions tagged [clojure-contrib]
108 questions
80
votes
5 answers
Building a Clojure app with a command-line interface?
I just started w/ Clojure (coming from Ruby) and I would like to build an small app with a command-line interface. How do I handle input/output to a CL?
I noticed that there is a clojure.contrib.command-line, but documentation is…

kush
- 16,408
- 17
- 48
- 65
67
votes
2 answers
Clojure XML Parsing
I can not find any info on how to parse xml documents and access elements.
I have found two ways to parse the xml document
(clojure.zip/xml-zip (clojure.xml/parse file))
and
(parse-seq file)
but i can seem to find any info on how to process the…

Hamza Yerlikaya
- 49,047
- 44
- 147
- 241
32
votes
4 answers
Create a list from a string in Clojure
I'm looking to create a list of characters using a string as my source. I did a bit of googling and came up with nothing so then I wrote a function that did what I wanted:
(defn list-from-string [char-string]
(loop [source char-string result ()]
…

robertpostill
- 3,820
- 3
- 29
- 38
25
votes
1 answer
How does ClojureQL compare to clojure.contrib.sql?
It looks like each one covers the basic cases like selecting certain columns and filtering by predicate pretty well, but I'm wondering how each compares for more advanced cases. Is it easier to express complex queries in one vis-à-vis the other? …

clizzin
- 1,236
- 13
- 15
21
votes
2 answers
How do I find which of my dependencies is downloading a particular jar?
One of my project.clj's :dependencies is dependent on the monolithic clojure-contrib-1.1.0.jar, but I can't guess which one is downloading it. Short of incrementally commenting out each one, how can I discover which of them is responsible ?

Hendekagon
- 4,565
- 2
- 28
- 43
19
votes
4 answers
How do I dynamically find metadata for a Clojure function?
Say I have the following code:
(defn ^{:graph-title "Function 1"} func-1
[x]
(do-something-with x))
(defn get-graph-title
[func]
(str
((meta func) :graph-title)))
I expect this to return "Function 1", but it returns nil. I think…

funkymunky
- 1,811
- 3
- 20
- 22
14
votes
4 answers
Where to find valid version numbers for dependencies in Leiningen
I'm new to Clojure and Leiningen, and I've determined that some of what I'll want to use is located in clojure.contrib.generic.math-functions. I found API information for that at…

Steve Jorgensen
- 11,725
- 1
- 33
- 43
10
votes
4 answers
How to call Clojure Macros from Java?
Is there anyway to call Clojure macros from Java?
Here is what I am trying to do:
RT.var("clojure.core", "require").invoke(Symbol.create("clojure.contrib.prxml"));
Var prxml = RT.var("clojure.contrib.prxml", "prxml");
Var withOutStr =…

mudgen
- 7,213
- 11
- 46
- 46
10
votes
2 answers
Use for the identity monad in Clojure
I've been reading an excellent introduction to monads for Clojure programmers. The article illustrates that the Identity monad is functionally equivalent to Clojure's let and that the Sequence/List monad is equivalent to for.
When the article gets…

G__
- 7,003
- 5
- 36
- 54
9
votes
2 answers
Insertions into Zipper trees on XML files in Clojure
I'm confused as how to idiomatically change a xml tree accessed through clojure.contrib's zip-filter.xml. Should be trying to do this at all, or is there a better way?
Say that I have some dummy xml file "itemdb.xml" like this:
-

ivar
- 1,484
- 12
- 20
9
votes
2 answers
Equivalent to clojure.contrib's show?
There used to be this useful utility called show in clojure.contrib. Now, that it's deprecated, is there an equivalent to it?
Thanks!

konr
- 2,545
- 2
- 20
- 38
8
votes
2 answers
Pass Sequence as Argument in Place of Multiple Arguments
How can I/should I pass a single sequence as an argument to a function which expects multiple arguments? Specifically, I'm trying to use cartesian-product and pass it a sequence (see below); however, when I do so the result is not the desired one.…

Ari
- 4,121
- 8
- 40
- 56
8
votes
2 answers
How do I combine results from zip-filter queries on an xml tree in Clojure?
I want to combine the results of three zip-filter queries on an xml tree. The XML I am parsing looks like this:
Surname A
…

Karl Jonathan Ward
- 360
- 3
- 11
7
votes
1 answer
IllegalStateException Compiling Clojure-Contrib
I am trying to compile my own version of clojure-contrib with Maven I get the following exception:
Exception in thread "main" java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: clojure.contrib.pprint/*format-str*,…

Hugo
- 6,244
- 8
- 37
- 43
7
votes
2 answers
How do I depend on every clojure contrib library?
I used to like to include all of clojure.contrib, and require all the libraries. This makes find-doc useful as a discovery tool.
Nowadays (clojure 1.4) clojure.contrib is split into many sub-libraries. And that rather spoils my scheme, and it also…

John Lawrence Aspden
- 17,124
- 11
- 67
- 110