来自《Clojure 乐趣》一书:
第一个例子:
(def fifth (comp first rest rest rest rest))
(fifth [1 2 3 4 5])
;=> e
第二个例子:
(defn fnth [n]
(apply comp
(cons first
(take (dec n) (repeat rest)))))
((fnth 5) '[a b c d e])
;=> e
为什么在第二个例子中(但不是在第一个例子中),我需要一个撇号?如果没有撇号,第二个例子将会引发错误。