brettrowberry.comTranspose a Matrix in ClojureImagine you have rows of letters, numbers, and Greek letters: [[:a :b :c] [:1 :2 :3] [:alpha :beta :gamma]] Now, imagine you want to transpose them: (mapv vector [:a :b :c] [:1 :2 :3] [:alpha :beta :gamma]) ;;=> [[:a :1 :alpha] ;; [:b :2 :beta]...Nov 6, 2025·1 min read
brettrowberry.comBinary Search in ClojureI decided to implement linear search before going after binary search. Now, I’m ready! With linear search, we required the elements be sorted. We didn’t require the elements be bounded. In binary search, the inputs must be bounded because we maintain...Nov 4, 2025·2 min read
brettrowberry.comLinear Search in ClojureI consider myself a classically trained computer scientist. However, I don’t regularly practice implementing algorithms at home. I hope to do more of that! At work, I do much higher level things, like partnering with a product manager, establishing a...Nov 2, 2025·3 min read
brettrowberry.comClojure +, +', and unchecked-add+ In Clojure core there’s a handy function, +. I’ll bet you know what it does: (+ 1 2 3) ;;=> 6 Let’s introduce a handy function as we explore: (defn value-and-type [& args] (map (juxt identity type) args)) Let’s look at the largest supported L...Oct 9, 2025·1 min read
brettrowberry.comClojure RatiosComputers do math really quickly. Yet, computers struggle with all kinds of things with math. Take, for example, the simple fraction: 2/3. This should be easy to store right? In most languages, it isn’t. We’re going to use 2/3 throughout all our exam...Oct 7, 2025·2 min read