Return the next value of stream argument n inside a stream
transformer. When used inside of defst, the name of the stream
argument can be used instead of its index n.
(defn pick
"Return the next value of stream argument n inside a stream
transformer. When used inside of defst, the name of the stream
argument can be used instead of its index n."
[n]
(fn [streams]
(let [[v ns] (stream-next (streams n))]
(if (nil? ns)
[nil nil]
[v (assoc streams n ns)]))))
Comments top
No comments for pick. Log in to add a comment.