4 ms·
Clojure folks do that. Don't know about all of them, but lots of them do. You even have emacs cider shortcuts to run tests from a live repl.
by mping 6y ago
Clojure folks do that. Don't know about all of them, but lots of them do. You even have emacs cider shortcuts to run tests from a live repl.
- capableweb 6y agoI concur. Use REPL driven development to arrive at a solution, but use unit tests (or similar) to make sure there are no regressions in the future and that it continues actually being a solution.
- ch4s3 6y agoThat's really cool. I need to revisit clojure in the near future.
- emidln 6y agoI literally wrote code in .clj files and then my editor can slurp that up and barf it into a repl. There was never a point where I was writing something that "only existed in the repl" such that I couldn't just put it in a unit test if it needed formalized. The usual workflow was something like (comment ;; experiments go here (defn add [a b] (+ a b)) (= 2 (add 1 1)) (= 3 (add 1 2)) (= 99 (add 9 90)) ) Once you have what you want, you move the code out of the comment block. Whether you move it into a library or a test file is just dependent on the type of thing you're moving. Functions moved into library code. The samples that proved the happy paths (or unhappy paths) would go into test files using `clojure.test/is` (and typically a direct copy/paste).