A list of commonly asked questions, design decisions, reasons why Clojure1 is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readability, but never changed a sentence) from mailing lists, articles, chats.
Table of Content
FP vs OOP
- What is the meaning of Data?
- Should I use a
namespace
to bundle functions to model a domain object like a "customer" or "product"? - Why Clojure does not implement something like CLOS?
- How is Clojure polymorphism different from Java or other languages?
- How Clojure compares to Scala?
Clojure Design
- Why no pattern matching?
- Why Clojure does not allow to introduce new syntax like Common Lisp?
- Why did you choose to make your language a Lisp dynamically typed as opposed to ML?
- Why no tail call optimization?
- Are there cons cells in Clojure?
- Aren't chunked sequences completely subverting the point of laziness?
- Why Clojure doesn't have a generic
insert
,lookup
,append
that works the same on all collections? - Why Clojure compiler is single pass? Aren't many possible optimizations lost this way?
Clojure Features
- Isn't the behavior of the STM unpredictable compared to manual locking?
- deftype, gen-class, proxy, reify, etc. Why there are so many ways to define a type?
- How does Clojure solve the potential ambiguity of multiple inheritance?
- Couldn't locals be mutable?
- When should I use atoms/refs/agents?
- Why there is a "rest" and a "next"?
- What is the difference between collections and sequences?
- Why lazy sequences are cached?
- Why cannot "last" be fast on vector?
- Shouldn't
(nth nil 1)
throw outofbound exception? - What is the convention for arguments order?
- Why doesn't contains? do what I expect on vectors and lists?
- Why commas are allowed as whitespaces?
- How Clojure transients work?
Learning, Process and Community
- How can I achieve programming mastery?
- Why you don't accept pull requests?
- Why Clojure is not licensed under GPL, MIT, etc?
- I want to study SICP and use Clojure instead of Scheme. Is that a good idea?
- What lessons did you learn porting some data structures from Okasaki ML into Java?
Footnotes
-
Clojure is a dynamic and functional dialect of the programming language Lisp on the Java platform. Like most other Lisps, Clojure's syntax is built on S-expressions that are first parsed into data structures by a Lisp reader before being compiled. Clojure's reader supports literal syntax for maps, sets, and vectors along with lists, and these are compiled to the mentioned structures directly. Clojure treats code as data and has a Lisp macro system. ↩