Hacker News new | ask | show | jobs
by swannodette 5404 days ago
Just to drive the point home, Clojure's core.clj is 6,500+ lines of Lisp, funny enough, parens do not dominate - http://twitpic.com/6hwt28/full.
1 comments

Well, there is a very good reason for this: Clojure tries to reduce the number of parentheses by substituting other characters, namely square brackets []. For example:

    ; Common Lisp
    (defun add (x y) (+ x y))
    ; Scheme
    (define (add x y) (+ x y))
    ; Clojure
    (defn add [x y] (+ x y))
Also, Clojure eliminates some parentheses that are used in other Lisps:

    ; Common Lisp and Scheme
    (cond ((> x 0) 1)
          ((= x 0) 0)
          (t -1))
    ; Clojure
    (cond (> x 0) 1
          (= x 0) 0
          :else -1)