Skip to content

Instantly share code, notes, and snippets.

@ztellman
Forked from bmmoore/gist:2015208
Created March 11, 2012 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ztellman/2015256 to your computer and use it in GitHub Desktop.
Save ztellman/2015256 to your computer and use it in GitHub Desktop.
trying to make a manyTill for gloss
(def empty-frame (compile-frame []))
(defn repeated-until [element done]
(let [element* (compile-frame element (fn [v] (if (nil? v) done v)) (fn [v] (if (= v done) nil v)))
self (promise)
impl (header element* (fn [elt] (if (nil? elt) empty-frame (compile-frame @self rest (partial cons elt)))) first)]
(deliver self impl)
impl))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment