Skip to content

Commit

Permalink
Convert dataflow to use reader conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcompton committed Jul 12, 2015
1 parent 2591683 commit 962d603
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -e

grench eval "(require 'bolth)"
grench eval "(do (bolth/pretty-refresh) nil)"
grench eval "(clojure.pprint/pprint (bolth/run-all-tests #\".*\" {:clear-screen true :warn-on-slow-test-limit-ms 10 :force-real-stdout true :show-slow-tests true}))"
7 changes: 5 additions & 2 deletions src/loom/dataflow.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
(set? start) start
(coll? start) (set start)
:else #{start})]
(loop [out-values {}
queue (into clojure.lang.PersistentQueue/EMPTY start)]
(loop [out-values {}
queue (into
#?(:clj clojure.lang.PersistentQueue/EMPTY
:cljs #queue [])
start)]
(let [node (peek queue)
worklist (pop queue)
in-value (join (mapv out-values (g/predecessors graph node)))
Expand Down

0 comments on commit 962d603

Please sign in to comment.