Skip to content

Commit

Permalink
properly comment the behavior of waiting-stream-check
Browse files Browse the repository at this point in the history
  • Loading branch information
David Nolen authored and David Nolen committed Sep 26, 2012
1 parent 8523c95 commit 6cef1f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/clojure/clojure/core/logic.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,14 @@
(defn waiting-stream? [x]
(vector? x))

(defn waiting-stream-check [w success-cont failure-cont]
(defn waiting-stream-check
"Take a waiting stream, a success continuation, and a failure continuation.
If we don't find any ready suspended streams, invoke the failure continuation.
If we find a ready suspended stream calculate the remainder of the waiting
stream. If we've reached the fixpoint just call the thunk of the suspended
stream, otherwise call mplus on the result of the thunk and the remainder
of the waiting stream. Pass this result to the success contination."
[w success-cont failure-cont]
(loop [w w a []]
(cond
(nil? w) (failure-cont)
Expand Down

0 comments on commit 6cef1f5

Please sign in to comment.