spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
Faris 2021-01-16T16:57:17.008600Z

Hi, sorry I’m super new at using Spacemacs, trying out REPL Driven development, I just wanna ask, whats the difference between cider-ns-refresh and cider-ns-reload and cider-eval-buffer and when should use which?

practicalli-john 2021-01-16T17:58:47.012700Z

@hewrin Its a very good question. Use cider-eval-buffer when you first start the REPL in cider (cider-jack-in or cider-connect), run this command with the main namespace file open in the current buffer. This will load all the code in that namespace, except commented code) and will load the all the Clojure core into Ciders memory (runtime state). This makes things like cider-doc work. Also use cider-eval-buffer if you made changes to a number of functions or defs and want to evaluate all the changes. It will update any changes to functions and defs (but not defonce expressions)

practicalli-john 2021-01-16T18:00:38.013600Z

Take a look at this page to understand more about refresh and reload (I dont really use them that much and sometimes its easier to restart the repl, but they can be useful) https://practicalli.github.io/spacemacs/clojure-repl/refresh-restart-repl.html

Faris 2021-01-16T18:54:34.017600Z

Thanks for the explanation @jr0cket! Am I correct in assuming I need to run cider-eval-buffer every time I make a change in my file for it to be able to be evaluated by the REPL?

practicalli-john 2021-01-16T23:49:44.022200Z

@hewrin you should evaluate changes to the code if you want to use them in the repl. These are usually done on a specific expression For example, if you change a function definition, defn expression, then you can just evaluate that defn expression using , e f I usually evaluate an expression as soon as I have changed it, to make sure it does what I think it does.

practicalli-john 2021-01-16T23:53:15.024600Z

If you have changed a few different expression without evaluating them, then evaluating the buffer is a quick way to do so.

practicalli-john 2021-01-16T23:58:03.027800Z

If you have any code you don't want to call when evaluating the buffer, for example experimental code, I use the (comment ,,, ) expression. I can still go an evaluate those expressions in the repl individual