3 ms·
"As the post states, it's certainly not needed for REPL interaction with a browser" Ok, it is not needed per se, but how can it be done without also writing yo
by seles 15y ago
"As the post states, it's certainly not needed for REPL interaction with a browser"
Ok, it is not needed per se, but how can it be done without also writing your own parser and evalulator? I didn't see mention of the how in the article.
Also it's not
Runtime eval: "Oh, wait, here's more program!"
It's: "Oh, you forgot this part of the program, that I already gave you an exact description of".
I'm not advocating any sort of complicated change, just evaluating simple independent expressions that generate the input to evals. I hypothosize that in most cases this is possible. Maybe eval is more often used in ways that does depend on input (REPL is such a case).
- JoelMcCracken 15y agoI'm not sure exactly how this would be implemented, but the repl action would be to send your browser clojurescript to a server, which then compiles it, which then replies to you, which you then append to the dom in a script() (or, eval it). This seems tricky, though, because it seems as though you'd need a to evaluate it within the context of the previously compiled environment, and ideally you would want to return /only/ the newly required code + libs. You wouldnt want to return code that re-initializes the dom, for example. https://github.com/ibdknox/brepl https://github.com/ibdknox/brepl has that repl implementation.