clojure

How well does Clojure perform when it comes to memory footprint?

As for the background, I am writing a web service in Clojure (using Compojure i this case). I am not worried about performance, that seems to be good enough and I can always fire upp more server instances. Even if a Clojure implementation would be 2-10 times slower than the corresponding Java implementation, I would always prefer a clea...

Clojure macros and symbol binding

not sure how to express this.. I've written a macro which takes two arguments. The first one essentially contains identifiers for generating a let expression. The second is the code to use inside the let expression (it wants to have access to these identifiers). An example: (match (Add {ast-> x}) (println x)) When the second argumen...

make sequence side-effectfull in Clojure

What I want to do is like following. (def mystream (stream (range 100))) (take 3 mystream) ;=> (0 1 2) (take 3 mystream) ;=> (3 4 5) (first (drop 1 mystream)) ;=> 7 The stream function make sequence side-effectfull like io stream. I think this is almost impossible. Here is my attempt. (defprotocol Stream (first! [this])) (defn st...

How can i minimize the AOT compilation in leiningen (Clojure)

When you create a Clojure project with leiningen all the *.clj-files are compiled AOT. Normally the AOT compilation is not necessary and I would like to minimize it. This is necessary for me to raise acceptance of Clojure as a complement in a Java-dominated environment. It is easier to "sell" a single class-file as the glue together wit...

Obtain a callstack in Clojure

When I run my Clojure programs and get an error during execution, I notice that the message printed by the REPL only contains the top level line number from the script I executed. Can I get it to dump a call stack (which references the various line numbers of Clojure code)? For example: user=> (load-file "test.clj") java.lang.IllegalA...