And here we go with another issue of Clojure Weekly! Clojure Weekly is a collection of bookmarks, normally 4/5, pointing at articles, docs, screencasts, podcasts and anything else that attracts my attention in the clojure-sphere for the last 7 (or so) days. I add a small comment so you can decide if you want to look at the whole thing or not. That’s it, enjoy!
Debugging with the Scientific Method - Stuart Halloway - YouTube Conj videos are already available (gone are the time you had to wait months for talks!). Debugging is a subject that we kind of give for granted. When you go deeper into the reasons behind it, the correct terminology and process there is still a lot to learn. Stuart gives an entertaining talk here despite the serious subject. There is a lot of common sense on what is said here about a scientific method, despite that the same old debugging mistakes are repeated over and over again. Remember: it’s always the garbage collector.
Condition Systems in an Exceptional Language - Chris Houser - YouTube Out of the very good selection at the Conj let me pick this great talk by Chris Houser (core committer, Joy of Clojure co-author and many other stuff). This talk is about condition systems, something already available in Lisp that is present with a few libraries for Clojure. A condition system is a flexible way to handle exceptions, giving clients a way to hookup into the exception propagation mechanism itself. The examples are inspired by chapter 19 from Practical Common Lisp book and the talk is anyway very rich in good references.
Clojure Destructuring Tutorial and Cheat Sheet A quick destructuring cheat-sheet with all the necessary pieces for effective splitting apart of your Clojure data structures. Worth remembering a couple of things: especially during interop scenarios map keys can come back as strings instead of keys. There is a : strs for that. Second: although a little bit evil, destructuring can be nested (map inside a vector inside a map and so on) with drastic reduction of lines of code.
Colin Fleming - Improving Clojure’s Error Messages with Grammars Another awesome talk from the Conj is this one by Colin Fleming of Cursive fame. The talk is great for many reasons: it touches on slowness of Clojure ticket process to fix also important problems, it shows all the possible ways to make mistakes on a (defn) declaration (wow, there are so many), a grammar to parse Clojure macros, how Cursive take advantage of that, the problem with error messages and Clojure adoption and all in a funny and entreating way. A final message: always look at the Scheme folks.
[#CLJ-1744] Unused destructured local not cleared, causes memory leak I was keeping an eye on some tweets and James Henderson added a real use case explaining how easily this problem can happen. I think I personally have tons of unused destructuring :as flying around and never payed too much attention to them. Just in case, if you are experiencing weird out of mem thinking you’re operating lazily on some big collection, double check all destructuring locals are being used