2014-01-18 12 views

Antwort

11

Die erste verwendet die Notation für Arity Overloading, enthält aber nur eine Arity.

Beispiel mit zwei arities:

(defn my-add 
    ([x] (+ x 1)) 
    ([x y] (+ x y))) 

(my-add 1) ;;=> 2 
(my-add 1 2) ;;=> 3 

Auch http://clojure.org/functional_programming (Suche nach arity Überlastung) sehen.