This post is the 6th part in a series dedicated to learning Clojure. This week, the subject is transducers. But before diving into that subject, we first need to talk more about reducers. If you have some experience in Java 8, you probably already know about the Stream.reduce() function. It's available in three different flavors.
Coming from a Java background, I'm currently trying to learn the Clojure programming language, with the help of online resources and mentorship. Some weeks ago, I tried to wire things together by trying to find equivalent methods to those available in Java streams. While I managed to get things working, writing working code and writing idiomatic code are two very different things. I was fortunate to have a good degree of feedback from different sources: Hacker News, Reddit and on this very blog.
This post is part of a series on learning the Clojure language. A common pattern in software development is the dynamic dispatching (or routing) table. The table is responsible for returning the relevant output for a specific input. In the Object-Oriented programming world, the object model would look something like the following.
For me, learning a new language is like getting into the sea: one toe at a time. Last week was the occasion to get familiar with the spec library. This week, we will have a look at some powerful macros. The problem When you’re not used to Clojure, parentheses may sometimes impair the readability of code. (- 25 (+ 5 (* 3 (- 5 (/ 12 4))))) The Kotlin equivalent of the above snippet would be: 25 - (5 + (3 * (5 - (12 / 4)))) Obviously, it’s related neither to Clojure nor
My new position requires me to get familiar with the Clojure language. In intend to document what I learn in a series of posts, to serve as my personal reference notes. As a side-effect, I hope it will also be beneficial to others who want to take the same path. There are already a multitude of great tutorials available: hence, each post will focus on a specific theme, that is specific to Clojure considering that most of my experience comes from OOP. As a newcomer to Clojure, a big issue of min
Recently, I had some some fun writing functional Kotlin to solve the FizzBuzz test. I asked for some feedback, and one of the answer I received was in Clojure: In Clojure there's the classic way, with condp and mod. There's also another way using cycle that I saw some years ago. The range and the 2 cycles will generate the fizz & buzz, the rest just decides what to print.Will be easier for you with syntax highlighting -> screenshots pic.twitter.com/wOPJD0BpGM— Alexandre Gri