Never miss a beat

Join my newsletter.

Tag: macros

Threading Pipelines in Clojure

Published: 12/24/2016

Today we’re going to talk about the thread macro ( -> ) and how to manipulate functions to fit them into your “thread pipeline”. First, let’s figure out what exactly the thread macro is. The Thread Macro If you’ve used -> before, you’ve done some threading. Other languages refer to this as “piping”, although this can be often confused with piping from the command-line. Check out this code (that doesn’t use the threading macro). Now this isn’t complicated, per se, but it could be a bit easier…

Understanding Clojure Macros

Published: 6/14/2016

Learning Clojure has been one of the most thought-provoking experiences of my life. Coming from a predominantly OOP background, it’s safe to say that it’s always been a bit of a challenge. Macro’s specifically, were a challenge that was hard for me to grasp, and I know cause a lot of pain points to new Clojuristas. To first understand a Macro, we must understand what a function does. What is a function? For the sake of this example – A function is a named procedure that tells a computer to do…