Created
July 28, 2016 20:50
-
-
Save timsgardner/c5fd196a1e240d99823279b4781c350e to your computer and use it in GitHub Desktop.
nothing to see here
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
| ;; ============================================================ | |
| ;; embarrassingly, the following totally works | |
| (def result (atom [])) | |
| (defn readr [prompt exit-code] | |
| (let [input (clojure.main/repl-read prompt exit-code)] | |
| (if (= input :tl) | |
| exit-code | |
| input))) | |
| (let [input (clojure.string/join "\n" | |
| ["(swap! result conj (+ 1 1))" | |
| ":tl"])] | |
| (binding [*in* (LineNumberingTextReader. | |
| (SynchronizedReader. | |
| (StringReader. input)))] | |
| (clojure.main/repl | |
| :prompt #(print "debug=> ") | |
| :read readr | |
| :eval eval))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment