| I'm a clojure newb but I've given it a serious try. The thing I feel most uncomfortable about is the development pipeline and how to debug errors (not necessarily with a debugger). I hope the cookbook has sections for this. For example, once you get started, I can type my program into the repl piece by piece and copy the working parts into my source file. Or, I can type my code into the source file and evaluate it with the repl. I imagine one choice has more pros/cons than the other. Emacs... I'm not using it, and I don't know what I'm missing. It seems like the majority of the hardcore clojurists are though and I'd like to know why. With debugging, I feel like the clojure error messages are not very helpful. I'm pretty sure this is just because I'm new to the language and the programming paradigm. Maybe that can't be taught and just takes time. But I also feel like there are a lot of debugging techniques out there I don't know about. I've documented my debugging complaints in detail on Stack Overflow here: http://stackoverflow.com/questions/16901836/how-do-i-get-bet... |
This is how I start Emacs:
And this is my workflow once I have source file and nrepl split-panes open: I actually rarely use the repl window since you can eval code in the source file.* I pretty much treat my source file as my repl and use `c-x c-e` to execute the previous form. (Screenshot: http://dl.dropbox.com/u/51836583/Screenshots/l0.png)
* Also, I'll often put the code I'm trying to get to work like `(my-func 1 2 3)` at the bottom of my source file. Then, while I'm hacking on `my-func`'s implementation, I mash `c-c c-k` (eval buffer) which returns the result of the last expression in the file.
* Another nice way to utilize `c-c c-k` is to put your `(assert (= (my-func 1 2 3) 42))` tests right into the source file. The tests will get run every time you eval the buffer. It's a solid test-driven loop baked into the core library!
(See more nrepl keymappings here: https://github.com/kingtim/nrepl.el#keyboard-shortcuts)