Clojure is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming.

learn more… | top users | synonyms

14
votes
6answers
3k views

Best practices in comment writing and documentation

Commenting nowadays is easier than ever. In Java, there are some nice techniques for linking comments to classes, and Java IDEs are good at making comment shells for you. Languages like Clojure even ...
25
votes
4answers
4k views

What limitations does the JVM impose on tail-call optimization

Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have ...
33
votes
4answers
4k views

What did Rich Hickey mean when he said, “All that specificity [of interfaces/classes/types] kills your reuse!”

In Rich Hickey's thought-provoking goto conference keynote "The Value of Values" at 29 minutes he's talking about the overhead of a language like Java and makes a statement like, "All those interfaces ...
9
votes
4answers
982 views

Python decorators and Lisp macros

When looking Python decorators someone made the statement, that they are as powerful as Lisp macros (particularly Clojure). Looking at the examples given in PEP 318 it looks to me as if they are just ...
6
votes
1answer
597 views

How to refactor a Java singleton to Clojure?

I'm writing a simple game in Java and I want to learn Clojure, so I've decided to refactor my current Java code to Clojure. The problem is that I've coded so much in object-oriented languages that I ...
4
votes
1answer
352 views

Is re-defing idiomatic in clojure?

Simple example: (def ticks 0) (defn run-iteration [] (def ticks (inc ticks))) Though the usual case involves things that don't change more than once every several hundred ms. How to do this ...