ClojureDocs

导航

名称空间

find

clojure.core

1.0 中可用 (源代码)
  • (find map key)
Returns the map entry for key, or nil if key not present.
2 Examples
(find {:a 1 :b 2 :c 3} :a)
;;=> [:a 1]

(find {:a nil} :a)
;;=> [:a nil]

(find {:a 1 :b 2 :c 3} :d)
;;=> nil 
;; Note for these examples: as the authoritative documentation speaks only about
;; map (as first parameter), passing anything else (e.g. a vector, like below)
;; uses an undocumented behavior, which can change anytime and so is unreliable and
;; should be avoided.

user=> (find [:a :b :c :d] 2)
[2 :c]

user=> (find [:a :b :c :d] 5)
nil

user=> (find [1 2 3] 4294967296)
[4294967296 1]
See Also

Returns the value mapped to key, not-found or nil if key not present in associative collection, se...

Added by AtKaaZ

Returns the value in a nested associative structure, where ks is a sequence of keys. Returns nil i...

Added by AtKaaZ

Returns true if key is present in the given collection, otherwise returns false. Note that for nu...

Added by reborg

Returns a map containing only those entries in map whose key is in keys

Added by cljlc
0 Notes
No notes for find