An arity is a function signature distinguished by how many arguments it accepts. In Clojure, a function can declare more than one arity, giving different calls different behavior without requiring separate function names. section 2.1.2
Declaring two arities
((fn ([] "a") ([x] "x"))) ;=> "a" ((fn ([] "a") ([x] "x")) 42) ;=> "x" Each parameter vector starts an arity: `[]` accepts no arguments, while `[x]` accepts one. With just one arity, `fn` can omit the parentheses around that declaration, as in `(fn [x] x)`. section 2.1.2
The same distinction matters when calling familiar arithmetic functions. Zero arguments produce identity values for `+` and `*`, but that arity is unavailable for `-` and `/`. With one argument, `+` and `*` return it, `-` changes its sign, and `/` returns its reciprocal. section 5.5
An empty collection
(apply + []) ;=> 0 (apply * []) ;=> 1 Because `apply` can call these functions with no arguments, their zero-argument arities give useful results even when the input collection is empty. section 5.5
Arity is about the argument count, not the types of the arguments or the value returned. Check each declared arity when choosing how to call a function—especially for zero- and one-argument cases. section 2.1.2 section 5.5




