You're viewing version 1.2.0 of pvalues. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

pvalues

clojure.core

  • (pvalues & exprs)
Returns a lazy sequence of the values of the exprs, which are
evaluated in parallel

2 Examples top

  • ;; expressions are calculated in parallel
    
    user=> (pvalues (expensive-calc-1) (expensive-calc-2))
    (2330 122)
    
  • ;; pvaules is implemented using Clojure futures.  See examples for 'future'
    ;; for discussion of an undesirable 1-minute wait that can occur before
    ;; your standalone Clojure program exits if you do not use shutdown-agents.
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:5456 top

(defmacro pvalues
  "Returns a lazy sequence of the values of the exprs, which are
  evaluated in parallel"
  {:added "1.0"}
  [& exprs]
  `(pcalls ~@(map #(list `fn [] %) exprs)))
Vars in clojure.core/pvalues: defmacro list map concat fn pcalls seq
Used in 0 other vars

Comments top

No comments for pvalues. Log in to add a comment.