
Clojure Cookbook is now accepting contributions - rkneufeld
http://contribute.clojure-cookbook.com
======
drchoc
For vim users, tim pope's fireplace plugin provides an integrated "quasi" repl
in vim: [https://github.com/tpope/vim-fireplace](https://github.com/tpope/vim-
fireplace). The only downside is I can't seem to figure out how to use it for
clojurescript. Also vim-slime is amazing for general purpose sending to
another tmux-pane: [https://github.com/jpalardy/vim-
slime](https://github.com/jpalardy/vim-slime). I use vim-slime when I'm
working with clojurescript.

------
zoowar
What percentage of the book revenue do you plan to share with contributors?

~~~
lukev
O'Reilly is has been flexible enough to let us crowdsource this and release it
freely to the community, but as far as the commercial sales of the print
version go, we're following a fairly traditional publishing model.

What author royalties there are will go towards getting print versions of the
book to our largest contributors, and then to Ryan and I as editors.

I don't think it would be feasible to split the royalties fairly amongst all
our contributors; not only would it be a large overhead, but the actual
amounts would be pretty tiny unless you've written a pretty large proportion
of the book. And if you do that, we'd be happy to talk to you about sharing
some of the royalties.

~~~
kenko
"the actual amounts would be pretty tiny unless you've written a pretty large
proportion of the book"

What proportion of the book do you expect the editors to write?

~~~
rkneufeld
That's a tough question to answer right now since we don't know how much help
we're going to get. I'm expecting Luke and I write _at least_ half of the
book–I'd be ecstatic if we got that much help.

On the other hand, should contributions be extremely low, we are still on the
hook with O'Reilly to deliver _all_ of the book.

------
tieTYT
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...](http://stackoverflow.com/questions/16901836/how-do-i-get-better-
feedback-from-clojure-errors)

~~~
danneu
I learned Clojure + Emacs + Evil-mode + nrepl.el at the same time a few months
ago and haven't really changed anything about my workflow since then.

This is how I start Emacs:

    
    
        * Open emacs
        * `c-x c-f` to navigate to and open my clj file
        * `c-c m-j` to start nrepl session (opens up in a pane split)
        * `c-w h/j/k/l` to move between windows
        * `m-x find-file-in-project` (I mapped to `;a`) to navigate to 
          other clj files in the git project
    

And this is my workflow once I have source file and nrepl split-panes open:

    
    
        * Edit code
        * `c-x c-e` to eval the expression above cursor
        * `c-c c-k` to eval entire source buffer
        * `m-hyphen c-c c-z` to load source file 
          namespace into nrepl window which I rarely do
    

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](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](https://github.com/kingtim/nrepl.el#keyboard-shortcuts))

~~~
tbatterii
I wish I could upvote you more. I've been playing with clojure for weeks and I
use nrepl, but it never clicked what a solid workflow could be.

