|
|
|
|
|
by daniel_solano
5404 days ago
|
|
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)
|
|