Welcome to this issue of Clojure Weekly. Clojure Weekly are just a few links to clojure-related posts, blogs, screencasts, presentations or podcasts I found over the Internet. I added a summary to each one of them so you can decide if you want to spend the time to look at the original! That’s it. Enjoy. Church encoding - Wikipedia, the free encyclopedia I'm still amazed by the fact that a language can be made of just anonymous functions. Church numerals defines how to encode numbers (and other primitive types of other languages) into high order function invocations. Counting becomes a matter of how many times a function is invoked over an argument. So λf.λx. f x can be read as the definition of a function that takes two arguments, f and x (the dot is the separation between them) and invokes f on x. We don't care about the name of the function as well we don't care about what happens when f is invoked on x. We care about how many times this is done and we can do all sort of calculations without ever invoking those functions. Polymorphism in Clojure | 8th Light Nice writeup of possible ways to implement polymorphic behaviour in Clojure. The truth comes at the end in the form of high order function: by passing in the behaviour you achieve the same effect as polymorphism, that is, not changing the calling function when new behaviour needs to be added. The rest of the blog is spent describing ways to mimic object orientation: multimethods, derive, protocol, deftype. It's still useful to handle group of polymorphic functions through protocols, since it makes clear the intent of the group of functions to work on the same data types. The extend-protocol type is used in this example to provide a to-json serialization to all clojure main type. Total Massacre: Reducing the Middle Office - Jon Pither, Håkan Råberg on Vimeo Reporting again on Jon Pither and team. This talk actually came before the series of article about clojure at a bank (the last one being http://www.pitheringabout.com/?p=778) I already linked here. The introduction of Clojure at this huge and legacy project at UBS has been done incrementally, starting with apparently innocuous replacement of feature and expanding inside out. The target was a text based rule engine that was creating waste and problems. The optimal target, a fairly isolated sub-system and a functional problem in nature. Then the standalone reporting app with Noir and friends, then Clojure concurrency for back-office re-conciliation and so on. They also prepared for the usual questions: why we shouldn't do that in Java, or is Emacs really necessary. The reason for success to me always look the same: 3-5 devs accept the Clojure challenge and start hacking with it. If they are good and believe in what they do there is no way to stop them. data structures - Test whether a list contains a specific value in Clojure - Stack Overflow It happened to me twice already and more are expected in the future, so let's see if I can remember with this note. The temptation to ask if a vector contains some elements is really too strong hence my surprise when the REPL replies FALSE when I ask (contains? ["a1" "a2"] "a2"). Yeah yeah, the (doc contains?) says it all. But why a standard library full of perls like the Clojure one doesn't contain a method to say if an element is contained in a vector? This stack overflow article summarise my frustration and also give a similar solution to the one I've found myself, that is either use 'some' or 'filter' with an anonymous function. Jay Fields' Thoughts: Clojure: Destructuring It is often referred to clojure destructuring as one of the many mini-language clojure has. Simply put destructuring allows implicit access to a collection, vector or map, to bind its single elements to local definitions. You'll find destructuring used with let form or with function parameters (which are simply a vector). The assignment is positional: based on the position of the required variables to be assigned, destructuring will attempt matching your request in order. It also works for collections of collections and when used consistently removes a lot of boiler plate code. In this article, Jay Fields does a great job explaining how simple that is. The Clojure Programming book also has a few examples about destructring at page 38.