Questions tagged [clojure-contrib]

Extensions and enhancements to the Clojure libraries.

108 questions
3
votes
1 answer

Any library for Java properties files in *new* contrib?

In the old monolithic clojure-contrib there were java-utils and properties namespaces with a few handy functions, like read-properties which parsed a Java properties file into a Clojure map. Is there an equivalent of these namespaces in the new…
Goran Jovic
  • 9,418
  • 3
  • 43
  • 75
3
votes
4 answers

how are you expected to install the clojure modular contribs?

The old monolithic clojure.contrib was available as a .jar from the same place you got the clojure .jar, and you used it by pointing your classpath at it. As far as I can tell, the new modular contribs aren't available in the clojure .jar --…
collapsinghrung
  • 855
  • 1
  • 6
  • 7
2
votes
2 answers

Problems while creating a deps.edn file

People, I decided to rewrite this post entirely to show it in a clear way. First of all, thanks for all the support. I appreciate that. This is the exercise in "The Clojure Workshop - Packt" where i've got stuck: (My IDE is IntelliJ and i'm using…
2
votes
1 answer

How to accept additional arguments for an option in tools.cli?

I'm a Clojure newbie. I need multiple arguments for option -a of my cli app, like: java -jar app.jar -a 12 abc xyz First one is a number, and other two have to be strings. My code is: ["-a" "--add LINE TYPE ENTRY" "Add entry to specified line…
Raj
  • 23
  • 1
  • 4
2
votes
1 answer

Can You Mix ClojureScript and JVM-Clojure in The Same Project?

I understand that their is Clojure the sits on the JVM in which you can use Java libraries. Also, there is ClojureScript which allows you to use JavaScript libraries, but is it possible to mix libraries from each in one Clojure file / project?
Jim
  • 3,821
  • 1
  • 28
  • 60
2
votes
1 answer

Clojure contrib sql makes all numbers a BigDecimal

The clojure.contrib.sql library returns BigDecimals for all numeric fields. What's a good way to have some fields as Integers? Example code below: (sql/with-connection my-db (sql/with-query-results res [sql-str 6722] (into []…
George
  • 3,433
  • 4
  • 27
  • 25
2
votes
2 answers

A Way To Gather All Bindings Of A Clojure Let-Expression

I'm finding myself writing a function that passes every variable bound in the enclosing let expression. The simplified form of this scenario, in psuedocode, is (let [a 1 b 2 c 3 d 4 e 5 f 6] (do-something a b c d) (f a b c d e f g) …
seewalker
  • 1,123
  • 10
  • 18
2
votes
1 answer

Eclipse Counterclockwise: How do I add clojure/contrib/sql to my class path.

In my code, I have: (ns Test.core (:require clojure.contrib.sql) ) The error statement is the following: FileNotFoundException Could not locate clojure/contrib/sql__init.class or clojure/contrib/sql.clj on classpath: …
user3745942
  • 193
  • 1
  • 2
  • 7
2
votes
2 answers

Multiple regular expressions in Clojure

What is the optimal way to couple multiple regular expressions within a Clojure function? I believe the function would start out as such: (defn foo [x] (re-seq #"some means to combine multiple regex") but am not clear if this is will work, or the…
sunspots
  • 1,047
  • 13
  • 29
2
votes
1 answer

Determining matrix dimensions

While previously attempting to ascertain the dimensions of a matrix, I have used the core.matrix function shape. This function has done exactly what I have asked. I input one nested vector into the function and output the dimension. However, I am…
sunspots
  • 1,047
  • 13
  • 29
2
votes
2 answers

Block Diagonal Matrix in Clojure

I looked through core.matrix searching for a block diagonal matrix function and searched Google, but have found no such function. Does such a function exist? If it does not could someone point me in the right direction to writing such a function.…
sunspots
  • 1,047
  • 13
  • 29
2
votes
2 answers

Clojure db-do-prepared calling with multiple parameters

I see following example in Clojure.java.jdbc (sql/db-do-prepared db "INSERT INTO fruit2 ( name, appearance, cost, grade ) VALUES ( ?, ?, ?, ? )" ["test" "test" 1 1.0]) But how do i convert following java code into clojure. I am new to clojure and…
Avinash
  • 12,851
  • 32
  • 116
  • 186
2
votes
3 answers

concatenating function that takes arbitrary inputs

I want to write a function that concatenates vectors or matrices, which can take arbitrary inputs. To combine two vectors I've written the follow code. It also also matrices to be combined such that columns are lengthened. (defn concats ([x y]…
sunspots
  • 1,047
  • 13
  • 29
2
votes
3 answers

If I'm making a mail system that manages large amounts of email would I be better off using james or Javamail

I'm trying to decide whether to use James(http://james.apache.org/) or Javamail(http://java.sun.com/products/javamail/) to build a email system that takes and processes email. It will send and recieve email along with processing the content,…
toofarsideways
  • 3,956
  • 2
  • 31
  • 51
2
votes
1 answer

how do i get rid of duplicate clojure test-is unit tests on the REPL

I have a little script (use :reload-all 'com.example.package1 'com.example.package2 'com.example.package3 'com.example.testlib) (run-tests 'com.example.package1 'com.example.package2 'com.example.package3) that I use to quickly reload…
Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284