Created
March 18, 2022 16:57
-
-
Save linktohack/ac6fcac6f19546e0b803af6de526b29d to your computer and use it in GitHub Desktop.
Hammerspoon fennel REPL
This file contains 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
(local fennel (require :fennel)) | |
(require :hs.ipc) | |
(let [coro (coroutine.create fennel.repl)] | |
(coroutine.resume coro {:readChunk (fn [] | |
(let [input (coroutine.yield)] | |
(.. input "\n"))) | |
:onValues (fn [xs] | |
(print (table.concat xs "\t"))) | |
:onError (fn [_ msg] | |
(print msg))}) | |
(set hs._consoleInputPreparser (fn [s] | |
(coroutine.resume coro s) | |
""))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment