kkinnear (5) [Avatar] Offline
I'm enjoying reading the book so far. It is hard to make the individual explanations interesting, but you are doing a great job. I really wanted this book four or five years ago, and it is still interesting -- particularly for functions that I don't use all that much.

In section 1.7 you discuss examining the sources to functions, particularly Clojure core functions. I have created a library that runs at the REPL and will pretty-print any Clojure core function (or any function defined in a file, actually) at the REPL and do syntax coloring as well. I mention it because since I created this library, I find that I look at the core functions a lot more than I used to, because I can trust the formatting, and because they are syntax colored. While all of the sources are formatted pretty well, the styles do vary a bit, and it is nice to know that the formatting is solid when trying to understand a function that somebody else wrote. I tend to rely on the visual structure of the code a lot, personally. Anyway, the library is https://github.com/kkinnear/zprint and to format a function at the REPL you just type (czprint-fn fn-name), and out it comes. The library is overly configurable, so if you don't like the way it formats by default, you can configure it in a huge variety of ways, including having a ~/.zprintrc file. You can configure it so that it will format the code in the way that you prefer (as opposed to how the author of the code or the author of zprint preferred). Anyway, this might make your life slightly easier, and it might also be useful for other folks that are exploring the standard library.

Thanks for writing this book. It truly needed to be done, and you are doing a much better job of it than I imagined that anyone would do!
reborg (11) [Avatar] Offline
Hi, thanks for your kind words! I agree: if only this book existed 5 years go smilie But here we are, better late than ever!

I have https://github.com/venantius/ultra in ~/.lein/profiles.clj and at least I'm not experiencing the dull-flat-gray experience of not having anything of that sort installed. I can see that ultra uses puget under the cover, that is one of the other tools you mentioned on the README of your project. BTW, configurability looks impressive in your README!

Glad there are other choices around so people can pick the one that they like the most. Keep up with the book, I hope you'll enjoy the rest of it.

Thanks for popping by