ClojureDocs

导航

命名空间

run!

clojure.core

自 1.7 起提供 (源代码)
  • (run! proc coll)
Runs the supplied procedure (via reduce), for purposes of side
effects, on successive items in the collection. Returns nil
2 Examples
(run! prn (range 5))
; 0
; 1
; 2
; 3
; 4
; returns nil

; compared to mapv
(mapv prn (range 5))
; 0                                                                                                                                                                                                                                  
; 1                                                                                                                                                                                                                                  
; 2                                                                                                                                                                                                                                  
; 3                                                                                                                                                                                                                                  
; 4                                                                                                                                                                                                                                  
; returns [nil nil nil nil nil] 
(run! #(http-out-create-person! %) [{:name "alex" :country :peru} 
                                    {:name "eddu" :country :peru}])

; (http-out-create-person! {:name "alex" :country :peru})
; (http-out-create-person! {:name "eddu" :country :peru})
; nil
See Also

Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by ...

Added by mars0i

Returns a lazy sequence consisting of the result of applying f to the set of first items of each c...

Added by mars0i

Returns a vector consisting of the result of applying f to the set of first items of each coll, fo...

Added by mars0i
0 Notes
No notes for run!