67
votes
4answers
8k views

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 ...
52
votes
2answers
13k views

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) ...
22
votes
1answer
2k views

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 ...
11
votes
4answers
2k views

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 ...
10
votes
2answers
784 views

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 ...
9
votes
3answers
401 views

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 = ...
8
votes
3answers
2k views

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 ...
8
votes
2answers
1k views

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 ...
7
votes
2answers
141 views

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 ...
7
votes
1answer
599 views

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: ...
7
votes
1answer
739 views

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: <someroot> <publication> <contributors> ...
6
votes
2answers
216 views

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 ...
6
votes
2answers
259 views

Find where clojure-contrib libs have moved to

Given how with future version of clojure are discouraging use of clojure-contrib as a single item - how do you find where things have moved to. For example - this utility: ...
6
votes
1answer
2k views

Tips for Html parsing and web driving with clojure?

I want to automate filling in data on a website using clojure. For this I want to query elements of webpages and create http requests. I have been looking at using HttpUnit and ...
5
votes
2answers
99 views

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, ...

1 2 3 4
15 30 50 per page