nrepl/piggieback

Implementation of :watch in cljs.repl/repl* is incompatible with per-expression invocation of the latter

cemerick opened this issue · 0 comments

:watch is implemented by spawning a new thread that watches the directory(ies?) specified, which is terminated by an atom being reset to false when cljs.repl/repl* exits. None of this is visible to outside callers, and so anything that builds its own control flow around the ClojureScript REPL (e.g. piggieback calling into repl* for each expression to be evaluated) will see the watcher start and immediately terminate.

A workaround would be to dissoc any user-supplied :watch option from those provided to repl*, and manage the lifecycle of the watch thread directly. Would require a mostly copy-paste of the relevant repl* code, which might be a source of future mismatch if there are later changes upstream.