4 ms·
Is there a way to write the changes in the REPL back to source file, or do I have to copy? I am wondering since trying out Clojure.
by MrBuddyCasino 9y ago
Is there a way to write the changes in the REPL back to source file, or do I have to copy? I am wondering since trying out Clojure.
- grzm 9y agoWith a set-up like Cider in Emacs (and I wouldn't be surprised if Cursive with IntelliJ has something similar), you can write code in a file and send it to the repl for evaluation.[0] This is a common method of development which accomplishes what you describe: code in a source file, evaluation in the repl. [0]: https://cider.readthedocs.io/en/latest/interactive_programming/ https://cider.readthedocs.io/en/latest/interactive_programmi...
- MrBuddyCasino 9y agoThanks, that makes sense (also to cormacrelf).
- cormacrelf 9y agoA better pattern is to use your editor as the REPL via SLIME or vim-fireplace or similar. Basically: 1. Headless server like nREPL for Clojure 2. Code editor that can send chunks of text to the headless repl and receive the output. Emacs and neovim (with its terminal) are pretty good at this. You can use commands to send the surrounding s-expression, paragraph, etc. 3. Ta da! Your text is already in your source file.