简体   繁体   English

Clojure:只返回值

[英]Clojure: just return the value

Is there any Clojure built-in function that just returns the value being passed to it? 是否有任何Clojure内置函数只返回传递给它的值? The equivalent of 相当于

(defn just-val [x] x)

?

Yes there is the identity function: http://clojuredocs.org/clojure_core/clojure.core/identity 是的,有身份功能: http//clojuredocs.org/clojure_core/clojure.core/identity

user=> (identity 4)
4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM