(fill-queue filler-func & optseq)
filler-func will be called in another thread with a single arg 'fill'. filler-func may call fill repeatedly with one arg each time which will be pushed onto a queue, blocking if needed until this is possible. fill-queue will return a lazy seq of the values filler-func has pushed onto the queue, blocking if needed until each next element becomes available. filler-func's return value is ignored.
filler-func will be called in another thread with a single arg 'fill'. filler-func may call fill repeatedly with one arg each time which will be pushed onto a queue, blocking if needed until this is possible. fill-queue will return a lazy seq of the values filler-func has pushed onto the queue, blocking if needed until each next element becomes available. filler-func's return value is ignored.
(seq-tree parent exit? node coll)
Takes a seq of events that logically represents a tree by each event being one of: enter-sub-tree event, exit-sub-tree event, or node event.
Returns a lazy sequence whose first element is a sequence of sub-trees and whose remaining elements are events that are not siblings or descendants of the initial event.
The given exit? function must return true for any exit-sub-tree event. parent must be a function of two arguments: the first is an event, the second a sequence of nodes or subtrees that are children of the event. parent must return nil or false if the event is not an enter-sub-tree event. Any other return value will become a sub-tree of the output tree and should normally contain in some way the children passed as the second arg. The node function is called with a single event arg on every event that is neither parent nor exit, and its return value will become a node of the output tree.
(seq-tree #(when (= %1 :<) (vector %2)) #{:>} str [1 2 :< 3 :< 4 :> :> 5 :> 6]) ;=> (("1" "2" [("3" [("4")])] "5") 6)
Takes a seq of events that logically represents a tree by each event being one of: enter-sub-tree event, exit-sub-tree event, or node event. Returns a lazy sequence whose first element is a sequence of sub-trees and whose remaining elements are events that are not siblings or descendants of the initial event. The given exit? function must return true for any exit-sub-tree event. parent must be a function of two arguments: the first is an event, the second a sequence of nodes or subtrees that are children of the event. parent must return nil or false if the event is not an enter-sub-tree event. Any other return value will become a sub-tree of the output tree and should normally contain in some way the children passed as the second arg. The node function is called with a single event arg on every event that is neither parent nor exit, and its return value will become a node of the output tree. (seq-tree #(when (= %1 :<) (vector %2)) #{:>} str [1 2 :< 3 :< 4 :> :> 5 :> 6]) ;=> (("1" "2" [("3" [("4")])] "5") 6)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close