Monthly Archives: August 2012

Experiencing beauty of thread macro in Clojure

While studying the Union-Find algorithm during the Algorithms, Part I course at coursera.org, I developed some functions to help me understand the topic in practice. Here’s a list of 10 consecutive numbers and the union function with its application. (def ids (range 10)) (defn union [ids p q]   (let [pid (nth ids p)   […]

Languages Tagged 4 Comments

A Decimal to Roman Numeral converter in Clojure

I stumbled upon the blog entry A Decimal to Roman Numeral converter in just a few lines where a Clojure function with loop/recur was presented. The solution was very concise yet it used loop/recur which I decided to replace with the functional trio – map, reduce and filter. I knew I could make it, but […]

Languages Tagged 4 Comments

A sample of Clojure destructuring from a blog post revisited

Reading blogs can be so thought-provoking. I did experience it today after having read Paul Sanwald’s clojure basics: argument destructuring. It’s so short and easy to follow that I read it a couple of times. I seem to not like it much, as it left me wondering how to improve the code. What stroke me […]

Languages Tagged Leave a comment