clojure

How to setup Aquamacs for Clojure development?

I've tried to migrate to Emacs several times for Clojure development, following a variety of blogposts, screencast and tutorials, but somewhere along the way something always went wrong - keybindings that didn't work, incompatible versions, etc, and I found myself scrambling back to Vim. But I know I want Paredit and SLIME. So, I'm goin...

What kind of applications are appropriate for clojure?

So, having just recently learned of Clojure, I'm interested in sinking my teeth into some good ol' functional programming again. What sort of applications would Clojure be good for? Web apps? Windowed client apps? Command-line utilities? What sort of applications is Clojure a terrible solution for? ...

How do I include java stuff in .jar files? [Clojure]

Okay. So here's my question: I am making a data parser in Clojure. One part of my program is that it has to be able to graph the data. I figure, I'll use jFreeChart. However, I have absolutely NO IDEA how to include stuff in JAR files. What I mean is: if I have a app.jar file in my classpath, I don't seem to be able to do: import app.th...

Clojure Jython interop

Hi, I was wondering if anyone has tried somehow calling Jython functions from within Clojure, and how you went about doing this if so. I have not used Jython, but I would imagine the Jython interpreter can be invoked in the same way as any other java code, and Python programs can be run within it. However I wonder if it would be possi...

Getting started with CSS in Compojure?

I found a very basic web page on the Internet and now I would like to do the obvious thing and add some CSS so I can build nicer pages. How can I include jQuery, as well as other style sheets? How can I include inline CSS so I can throw in a text-align: center, for example, to try out quick changes? Regular jQuery include: <script...

Clojure- why doesn't this piece of code work in clojure, is there some lazy evaluation gotcha I am missing ?

Am new to clojure and learning it by working through SICP. I cannot get this piece of code from SCIP 1.3.1 to work. What am I missing ? (defn sum [term a next b] (if (> a b) 0 (+ (term a) (sum term (next a) next b)))) (defn sum-cubes-new [a b] ((sum cube a inc b))) HERE is the error message: java.lang.Integer can...

A good alternative to GWT for Clojure

I am writing a webapp in Clojure. I almost want to use Google Web Toolkit for the frontend -- since I can just write Clojure/Java code, and have the library automatically generate the Javascript/AJAX. However, for some reason, GWT does not sem to be used much in the real world. Is there something that is similarly tied into Java (like...

Using clojure and leiningen with IDEs

I'm looking at switching my projects build from Ant to leiningen and wanted to know if there is a Clojure IDE (intellij, eclipse, netbeans) for which the "build" and "debug" buttons will still work? ...

building Debian and Redhat packages with leiningen

Moving my project from Ant to Leiningen went so smoothly that I am looking at new things to include in the build process. one of which would be to automatically create a .deb and .rpm file in the build. What is the easiest way to do this? ...

Clojure MySQL Syntax Error Exception ("[...] near '????????????????' [...]")

Hi there, I'm having trouble doing anything with clojure.contrib.sql beyond establishing a connection. I have a mysqld running on localhost:3306 with a database called clj_db. The user 'clj_user'@'localhost' with password 'clj_pass' can access this database. When trying to "select * from clj_table" I get a "com.mysql.jdbc.exceptions.M...

Using Clojure with Vaadin

Hi, Has anyone tried implementing a web application with Clojure ( using Compojure ) and Vaadin ? I had seen an article on using Clojure with JWT for creating web apps. Vaadin is based on GWT so you get a lot of the advantages of GWT ( though Vaadin is completely Server-centric). And Clojure gives the advantage that you can use any Java...

Different solutions for Clojure implementation of problem

Here is a problem Statement : Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. The solution is long, (defn large [x y] (if (> x y) x y)) (defn large-3 [x y z] (if(> (large x y) z) (large x y) z)) (defn small [x y] (if (< x y) x y)) (defn small-3 [x y z] (if (...

List of Clojure Compatible Java Virtual Machines.

A community wiki to vote up for "i have used this jvm with clojure without problems" down "i have used this jvm with clojure and had problems" Specifying the problems in the comments will help others to tell if the risk applies to them. ...

Integrating Clojure into an existing Java project?

How can I take a large existing Java project and start to add Clojure modules? For example, in the code below, I'd like to make the following functions available in Java: state?, zip?, state-list, zipcode-list. The two predicates will return a boolean, but the "getters" will return arrays. (def *states* (list "NJ" "NY" "CA")) (def *z...

Calling clojure from java

Most of the top google hits for "calling clojure from java" are outdated and reccomend using clojure.lang.RT to compile the source code. Could you help with a clear explanation of how to call Clojure from java assuming you have already build a jar from the clojure project and included it in the class path? ...

Tail Call Elimination in Clojure?

Can somebody rewrite this (plt) Scheme code into Clojure? (define (f n) (printf "(f ~a)~n" n) (g n)) (define (g n) (printf "(g ~a)~n" n) (h n)) (define (h n) (printf "(h ~a)~n" n) (f (+ n 1))) In such a way as to not collapse the procedures f, g, and h together and to allow the code to run indefinitely without cras...

Are there any good Clojure benchmarks?

Edit: The Clojure benchmarks are up on the Benchmarks Game. I have made this question community wiki and invite others to keep it updated. Is anyone aware of benchmarks of Clojure's performance? I have done some of my own (although nothing too formal) and it didn't fair too well in comparison to other functional languages (tried...

Merge list of maps and combine values to sets in Clojure

What function can I put as FOO here to yield true at the end? I played with hash-set (only correct for first 2 values), conj, and concat but I know I'm not handling the single-element vs set condition properly with just any of those. (defn mergeMatches [propertyMapList] "Take a list of maps and merges them combining values into a s...

Functional language implementations of Production Grade data stores

There are many datastores written in Erlang, for example Riak, Dynomite, CouchDb, Scalaris, have I missed any? I know that Java and C/C++ have also been used to write datastores (Cassandra, Hypertable, etc), but have any Datastores been written in any other functional languages such as F#, Scala, Haskell, Clojure, etc? The reason I am a...

How do I figure out what namespace I need to import from a java library?

I'm writing some clojure code, and I'm relying on Joda time for time handling. The problem is that I don't know what to import and the documentation isn't terribly clear about it. Now I know that somebody here can probably give me the correct answer in less than 5 seconds, but I'd rather know how to figure this one out on my own (aside...