Reputation: 58953
Is there any Clojure built-in function that just returns the value being passed to it? The equivalent of
(defn just-val [x] x)
?
Upvotes: 6
Views: 1011
Reputation: 1464
Yes there is the identity function: http://clojuredocs.org/clojure_core/clojure.core/identity
user=> (identity 4)
4
Upvotes: 11