clojure when macro

Viewed 1662

I was browsing the clojure source and I was surprised by the way the when macro is defined:

user=> (source when)
(defmacro when
  "Evaluates test. If logical true, evaluates body in an implicit do."
  {:added "1.0"}
  [test & body]
  (list 'if test (cons 'do body)))
nil
user=>

I was expecting it to be written something like this instead:

(defmacro when [test & body] `(if ~test (do ~@body)))

Why was the actual macro written in this less usual way?

1 Answers
Related