Clojure Weekly, Sep 9th, 2015
Welcome to another issue of Clojure Weekly! Here I collect a few links, normally 4/5 urls, 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!
memfn - clojure.core I knew it was somewhere in the stdlib but I couldn't remember the name. Better bookmark it. memfn is that little macro that you need when you want to treat Java method as first class functions, like any other Clojure function. Without memfn you have to do contorsionism with (fn) or #(%) forms. memfn also allows for partial application on Java methods. For instance, (memfn toUpperCase) is already a partial form: ((memfn toUpperCase) "abba").
State of the Common Lisp Ecosystem, 2015 Another "state of the X ecosystem" article, this time for Common Lisp (after the one for Haskell I read last week). These posts are interesting, since they give you a quick glimpse inside a language/community, including ideas about the past and future. Clojure has something similar with its annual survey hopefully coming this year as well.
killme2008/defun Interesting. You can do quite a bunch of hard-core pattern matching stuff with this library for Clojure. We go from something similar to multimethods to more complicated guards on arguments supporting arbitrary code. I've used pattern matching in Haskell where thanks to the language supporting it natively is quite idiomatic. Going back to Clojure I never felt the need though.
Everything Is a Ghetto: SICP Distilled Now Public Quick mention for SICP distilled going public. The project goal is to provide the highlights of SICP in a modern language like Clojure. In the website you can find a selection of paragraphs from SICP with examples and exercises re-written in Clojure. A nice accomplishment which is not yet finished (there are many "check back soon" sections). I'm not sure if I can suggest you to go straight to SICP distillied without ever touching the original but it might help if you want to compare how it translates to Clojure.
Contributing to Clojure โ Inside Clojure The definitive guide to becoming a Clojure contributor, by Alex Miller. All the links I collected in the weekly related to interesting Jira pages are summarized here. It contains things like "newbie" tickets, how to create patches to attach to tickets and a definitive state diagram with all the steps for a contribution to finally get into the next version of Clojure.
CLJ-1449 Add new clojure.string functions ยท clojure/clojure@722e023 Ooooh... so things change for Clojure as well. It's years of using java interop for things like the index of char in a string that I thought something like this was out of discussion. Forever. So can I finally avoid testing for nil? Nope.
Resolving function from string name - Stack Overflow I remember doing this a lot in my Java days, looking up methods by reflection was one of the most powerful tools in Java land, allowing all sort of late binding. In Clojure is a rare event but it can be handy at times. The use case is the usual duplication of some function call, only slightly changing by a couple of parameters. There are sensible alternatives like multimethods, but sometimes you can quickly get away using a symbol to lookup a function in a namespace, like ((ns-resolve 'clojure.string 'lower-case) "BlahBlah") and have a bunch of other invoking functions passing 'lower-case 'upper-case and so as a param. Use when you see fit.














