29 ms·
You don't get code out of the REPL. You evaluate your code inside the REPL, often directly from the source files. For example I'll often write a function in a
by jeremiep 10y ago
You don't get code out of the REPL. You evaluate your code inside the REPL, often directly from the source files.
For example I'll often write a function in a source file, evaluate it from there so it exists in the process, then call it from the REPL to test it works correctly.
When I launch the program, every temporaries made at the REPL are gone, but the source stays.
- cygned 10y agoThat is the workflow I currently use, too. Luckily, Leiningen reloads most of my changes. I wished, though, there was the ability to save the current name space from the REPL. Hacking together a couple of functions and save their definitions when you're happy.
- dustingetz 10y agoThat's inverted I think. For JVM clojure I am always editing inside a .clj file, all the scrap goes in (comment) forms in the file and I send forms to the repl from the file. I rarely actually type in the repl.
- jeremiep 10y agoSame here, I only type at the REPL what I don't mind to lose after a reboot. Everything else is in *.clj/s/c files.