Skip to content

Commit

Permalink
e/with-cycle* experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
dustingetz committed Sep 6, 2024
1 parent 7573ccc commit a3c9951
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/hyperfiddle/electric3.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ this tuple. Returns the concatenation of all body results as a single vector.
`(let [a# (atom ~i) ~s (watch a#)]
(reset! a# (do ~@body))))

(defmacro with-cycle* [kf [s s0] & body] ; hacked support for amb cycles, fixme
`(let [kf# ~kf]
(e/diff-by kf#
(e/with-cycle [~s (e/as-vec ~s0)]
(let [~s (e/diff-by kf# ~s)]
(e/as-vec (do ~@body)))))))

(hyperfiddle.electric3/defn Count [xs] (-> xs pure i/count input))

;; mklocal = declare lexical slot
Expand Down

0 comments on commit a3c9951

Please sign in to comment.