Closed cgrand closed 7 years ago
At first I thought CLJS would have to solve its dynvar issue first.
Then I thought the dynvar handling could be abstracted so that CLJS would not commit to a dynvar impl yet.
Now I realize that the only parts of "in-between" where having dynvars set is when running code, that is when *eval-fn*
(for evaluating js code) is called. So it just need to be wrapped in function that set dynvars!
eval
in self-hosted cljs has an async api (a callback is called with the result or error from the evaluation). Right now it's a provision (in case some IO for example has to be made during eval).The problem is that
cljs-js-repl
makes intensive use of dynamic variables. They are set wheneval
is called, they can ve set again when the callback is called but not in between (again it's not a problem currently becauseeval
impl is sync in Lumo and Planck, so there's no in-between.