Created
March 11, 2012 05:55
-
-
Save bmmoore/2015208 to your computer and use it in GitHub Desktop.
trying to make a manyTill for gloss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def empty-frame (compile-frame [])) | |
(defn repeated-until [element done] | |
(let [element* (compile-frame element (fn [v] (if (nil? v) done)) (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