<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Joep Schuurkes (Posts about clojure)</title><link>https://smallsheds.garden/</link><description></description><atom:link href="https://smallsheds.garden/categories/clojure.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2026 &lt;a href="mailto:site@joep.slmail.me"&gt;Joep Schuurkes&lt;/a&gt; 
&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" rel="nofollow" target="_blank"&gt;
&lt;img alt="Creative Commons BY-NC License" style="border-width:0;margin: 0px 0px 0px 0px" src="https://licensebuttons.net/l/by-nc/4.0/80x15.png" /&gt;
&lt;/a&gt;
</copyright><lastBuildDate>Sun, 08 Mar 2026 16:40:47 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A lesson from every language I've used</title><link>https://smallsheds.garden/blog/2023/a-lesson-from-every-language-ive-used/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;Throughout the years I've used quite a few different languages - if you allow me to be somewhat generous with the word "use". One language I actually feel proficient in. Some languages I've only done coding exercises in. And one language I've only used for a total of maybe 10 minutes, but that did really help out a whole team.&lt;/p&gt;
&lt;p&gt;I do believe we should be that generous, both towards ourselves and to others. For an industry that likes to talk about imposter syndrome, we seem to enjoy saying &lt;em&gt;"You're not a real ... unless..."&lt;/em&gt; a bit too much.&lt;/p&gt;
&lt;p&gt;Listing these languages for myself made me wonder what I had learned from them. Did I just learn how to write some code in each of them? Or did I also pick up some more general lessons? Turns out I did.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/2023/a-lesson-from-every-language-ive-used/"&gt;Read more…&lt;/a&gt; (5 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>clojure</category><category>programming</category><category>python</category><guid>https://smallsheds.garden/blog/2023/a-lesson-from-every-language-ive-used/</guid><pubDate>Thu, 28 Dec 2023 23:00:00 GMT</pubDate></item><item><title>(clj 12) Core concepts of functional programming with Peg Thing</title><link>https://smallsheds.garden/blog/clojure/2023/clj-12-core-concepts-of-functional-programming-with-peg-thing/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;Chapter 5 of "&lt;a href="https://www.braveclojure.com/clojure-for-the-brave-and-true/"&gt;Clojure for the Brave and True&lt;/a&gt;" explores two core concepts of functional programming: pure functions and immutable data structures. It wraps up with walking you through the &lt;a href="https://github.com/flyingmachine/pegthing"&gt;code&lt;/a&gt;&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="https://smallsheds.garden/blog/clojure/2023/clj-12-core-concepts-of-functional-programming-with-peg-thing/#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt; of a game called &lt;a href="https://www.braveclojure.com/functional-programming/#Peg_Thing"&gt;"Peg Thing"&lt;/a&gt;&lt;sup id="fnref:2"&gt;&lt;a class="footnote-ref" href="https://smallsheds.garden/blog/clojure/2023/clj-12-core-concepts-of-functional-programming-with-peg-thing/#fn:2"&gt;2&lt;/a&gt;&lt;/sup&gt;, which uses &lt;em&gt;"everything you've learned so far: immutable data structures, lazy sequences, pure functions, recursion - everything!"&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;So what is this Peg Thing?&lt;/h2&gt;
&lt;p&gt;For a full description and the code of Peg Thing, you can follow the links in the paragraph above. In this post I'll only share what's relevant to describe what I learned about functional programming through Peg Thing.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2023/clj-12-core-concepts-of-functional-programming-with-peg-thing/"&gt;Read more…&lt;/a&gt; (8 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><guid>https://smallsheds.garden/blog/clojure/2023/clj-12-core-concepts-of-functional-programming-with-peg-thing/</guid><pubDate>Sun, 06 Aug 2023 13:13:36 GMT</pubDate></item><item><title>(clj 11) Moving on from some unsolved exercises</title><link>https://smallsheds.garden/blog/clojure/2022/clj-11-moving-on-from-some-unsolved-exercises/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;At the end of chapter 4 of &lt;a href="https://www.braveclojure.com/clojure-for-the-brave-and-true/"&gt;"Clojure for the Brave and True"&lt;/a&gt; there are &lt;a href="https://www.braveclojure.com/core-functions-in-depth/#Exercises"&gt;four exercises&lt;/a&gt;. This post is about me deciding to move on to chapter 5 after solving 1.5 of these exercises.&lt;/p&gt;
&lt;h2&gt;The challenge with these exercises&lt;/h2&gt;
&lt;p&gt;A good example to talk about the challenge with these exercises is the second one:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Write a function, append, which will append a new suspect to your list of suspects.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-11-moving-on-from-some-unsolved-exercises/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><guid>https://smallsheds.garden/blog/clojure/2022/clj-11-moving-on-from-some-unsolved-exercises/</guid><pubDate>Thu, 29 Dec 2022 15:08:36 GMT</pubDate></item><item><title>(clj 10) The mapify function of (clj 9) revisited</title><link>https://smallsheds.garden/blog/clojure/2022/clj-10-the-mapify-function-of-clj-9-revisited/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;In my &lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-9-how-to-figure-out-what-a-function-does/"&gt;previous Clojure post&lt;/a&gt; I covered the code example at the end of Chapter 4 of &lt;a href="https://www.braveclojure.com/clojure-for-the-brave-and-true/"&gt;"Clojure for the Brave and True"&lt;/a&gt;. Or rather, I focused on a single function in the example, called &lt;code&gt;mapify&lt;/code&gt;, and described how I figured out what it does. At the &lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-9-how-to-figure-out-what-a-function-does/#the-mapify-function"&gt;end of that post&lt;/a&gt; I shared my disappointment:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Having done all this work (and writing) I can't help but feel a bit disappointed. In the end, the function does not seem to do a lot.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And I shared a Python version of that same function, claiming that it basically does the same thing&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="https://smallsheds.garden/blog/clojure/2022/clj-10-the-mapify-function-of-clj-9-revisited/#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;However, less than a week after publishing the post, I got a very kind email by someone named Martin. And &lt;em&gt;"in defence of clojure and to maybe reduce your disappointment"&lt;/em&gt; Martin pointed out the two versions are not as equivalent as I claimed, because the Clojure version is more general than the Python version. So I looked at the two version again and the way they are different turned out to be quite interesting - interesting enough to write a follow-up post.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-10-the-mapify-function-of-clj-9-revisited/"&gt;Read more…&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><guid>https://smallsheds.garden/blog/clojure/2022/clj-10-the-mapify-function-of-clj-9-revisited/</guid><pubDate>Wed, 13 Jul 2022 19:02:36 GMT</pubDate></item><item><title>(clj 9) How to figure out what a function does</title><link>https://smallsheds.garden/blog/clojure/2022/clj-9-how-to-figure-out-what-a-function-does/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;Chapter 4 of "&lt;a href="https://www.braveclojure.com/clojure-for-the-brave-and-true/"&gt;Clojure for the Brave and True&lt;/a&gt;" concludes with a &lt;em&gt;Vampire Data Analysis Program&lt;/em&gt;, serving as a summary of the chapter. The book shows some code, explains it, moves on to the next bit of code, etc. I'm not sure why, but I decided I wanted to figure out the code on my own and then read the explanation to see if I got it right. Afterwards I realized it might make a good blog post: both explaining what the program does and what techniques (for lack of a better word) I used to figure it out.&lt;/p&gt;
&lt;p&gt;With most of the work in the program being done by a function called &lt;code&gt;mapify&lt;/code&gt;, this blog post will focus on that single function. As it turns out, it took me more than 2000 words (footnotes not included) to describe what this function consisting of only 9 lines does. So feel free to read all of it, skim through it, or skip straight ahead to the &lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-9-how-to-figure-out-what-a-function-does/#techniques"&gt;techniques&lt;/a&gt; and some &lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-9-how-to-figure-out-what-a-function-does/#reflections"&gt;reflections&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-9-how-to-figure-out-what-a-function-does/"&gt;Read more…&lt;/a&gt; (16 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><category>python</category><guid>https://smallsheds.garden/blog/clojure/2022/clj-9-how-to-figure-out-what-a-function-does/</guid><pubDate>Sun, 12 Jun 2022 13:01:36 GMT</pubDate></item><item><title>(clj 8) Some notes on lazy sequences and function parameters</title><link>https://smallsheds.garden/blog/clojure/2022/clj-8-some-notes-on-lazy-sequences-and-function-parameters/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;Almost done with the chapter 4 &lt;em&gt;"Core Functions in Depth"&lt;/em&gt; of "&lt;a href="https://www.braveclojure.com/clojure-for-the-brave-and-true/"&gt;Clojure for the Brave and True&lt;/a&gt;"! Before wrapping up the chapter with a longer example, a summary, and some exercises, the book goes into lazy sequences, the collection abstraction, and function functions. In this post I will share some notes on infinite lazy sequences and function parameters, making comparisons between Clojure and Python.&lt;/p&gt;
&lt;h2&gt;Infinite lazy sequences&lt;/h2&gt;
&lt;p&gt;A lazy sequence is a sequence whose members aren't computed until you try to access them. One advantage is that it's more efficient: the whole sequence doesn't have to be calculated and kept in memory from the start. Another advantage is that it allows you to create infinite sequences. Do that with a normal sequence and your program would never want to stop calculating.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2022/clj-8-some-notes-on-lazy-sequences-and-function-parameters/"&gt;Read more…&lt;/a&gt; (4 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><category>python</category><guid>https://smallsheds.garden/blog/clojure/2022/clj-8-some-notes-on-lazy-sequences-and-function-parameters/</guid><pubDate>Mon, 18 Apr 2022 12:16:36 GMT</pubDate></item><item><title>(clj 7) Programming to abstractions with sequence functions</title><link>https://smallsheds.garden/blog/clojure/2021/clj7-programming-to-abstractions-with-sequence-functions/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;Looking at my progress so far, I realized it's time re-evaluate this whole learning Clojure-thing. After looking through the table of contents of "&lt;a href="https://www.braveclojure.com/"&gt;Clojure for the Brave and True&lt;/a&gt;" and giving it some thought, I decided to make two changes to how I'll proceed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I will start writing shorter posts and write them more often.&lt;/li&gt;
&lt;li&gt;My goal is to finish &lt;em&gt;"Part II: Language Fundamentals"&lt;/em&gt;. I don't have to do &lt;em&gt;"Part III: Advanced Topics"&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Completing Part II will still take quite some work. I've worked through the two first sections of chapter 4 (5 sections left in that chapter) and Part II goes up to chapter 8. So no time to waste: let's take a look at sequence functions and programming to abstractions.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2021/clj7-programming-to-abstractions-with-sequence-functions/"&gt;Read more…&lt;/a&gt; (7 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><category>python</category><guid>https://smallsheds.garden/blog/clojure/2021/clj7-programming-to-abstractions-with-sequence-functions/</guid><pubDate>Sun, 05 Dec 2021 12:40:36 GMT</pubDate></item><item><title>(clj 6) Three chapters in one year</title><link>https://smallsheds.garden/blog/clojure/2021/clj6-three-chapters-in-one-year/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;It's been a bit more than a year since I posted my &lt;a href="https://smallsheds.garden/blog/clojure/2020/clj0-diving-straight-in/"&gt;first blog post&lt;/a&gt; about learning Clojure. And it's been five months since my &lt;a href="https://smallsheds.garden/blog/clojure/2020/clj5-loop-and-recur-into-and-conj/"&gt;last blog post&lt;/a&gt; about it. So far I've made it through the first three chapters&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="https://smallsheds.garden/blog/clojure/2021/clj6-three-chapters-in-one-year/#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt; of "&lt;a href="https://www.braveclojure.com/clojure-for-the-brave-and-true/"&gt;Clojure for the Brave and True&lt;/a&gt;". Instead of commenting on my learning pace at the start of every post, I've decided that this pace is the pace that works for me at this time, so there's no need to keep revisiting the topic.&lt;/p&gt;
&lt;p&gt;Something I do want to mention is that one thing that triggered me to do some more Clojure was &lt;a href="https://itrevolution.com/the-idealcast-episode-10/"&gt;this episode&lt;/a&gt; of Gene Kim's excellent &lt;a href="https://itrevolution.com/the-idealcast-podcast/"&gt;Idealcast&lt;/a&gt; podcast with &lt;a href="https://www.michaelnygard.com/"&gt;Michael Nygard&lt;/a&gt;, in which they spend some time talking about Clojure.&lt;/p&gt;
&lt;h3&gt;Vim macros&lt;/h3&gt;
&lt;p&gt;The exercises at the end of chapter 3 got me to try out a lot of things, so I got bored having to type in the commands to copy a line (&lt;code&gt;yy&lt;/code&gt;), paste it (&lt;code&gt;p&lt;/code&gt;), replace it by its evaluation (&lt;code&gt;c!$&lt;/code&gt;), comment it out (&lt;code&gt;gcc&lt;/code&gt;), and add a "&lt;code&gt;=&amp;gt;&lt;/code&gt;" to mark it as output. So I learned about Vim macros and recorded that sequence to run when I hit &lt;code&gt;@c&lt;/code&gt;. At the end of my &lt;a href="https://smallsheds.garden/blog/clojure/2020/clj4-learning-when-maps-closures/"&gt;(clj 4)&lt;/a&gt; post I mentioned I might have to do this. Guess that moment came sooner than I expected.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2021/clj6-three-chapters-in-one-year/"&gt;Read more…&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><guid>https://smallsheds.garden/blog/clojure/2021/clj6-three-chapters-in-one-year/</guid><pubDate>Sat, 08 May 2021 08:53:25 GMT</pubDate></item><item><title>(clj 5) Loop and recur, into and conj</title><link>https://smallsheds.garden/blog/clojure/2020/clj5-loop-and-recur-into-and-conj/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;Yet again it's been a while since I did some Clojure or blogged about it. This time I'm writing this blog post
three months after working on the code on September 5, 6 and 12. I'm not going to dwell on that too long, because
other things in my life were more important. I did feel a little sad when this year's &lt;a href="https://adventofcode.com/"&gt;Advent of Code&lt;/a&gt;
launched and I realized my Clojure is nowhere near a state where I could attempt the puzzles. So I ended up doing
the first 10 days in Python, which is twice as far as I got last year.&lt;/p&gt;
&lt;p&gt;I also feel like my current approach to learning lends itself well enough to going slow. Taking my time to play around
and make notes with while working through a section of &lt;a href="https://www.braveclojure.com/"&gt;Clojure for the Brave and True&lt;/a&gt;
and then revisiting my code and notes later to write a blog post, does seem to result in stuff actually sticking in my memory.
(Disclaimer: am writing this before writing the rest of this blog post.) Slow is smooth and smooth is fast, as they say.&lt;/p&gt;
&lt;p&gt;The section I tackled in September is "Pulling It All Together" from Chapter 3, which describes the construction of a 
piece of code of about 50 lines in which - I'm sorry to say -  a hobbit gets hit in different body parts.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2020/clj5-loop-and-recur-into-and-conj/"&gt;Read more…&lt;/a&gt; (6 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><category>python</category><guid>https://smallsheds.garden/blog/clojure/2020/clj5-loop-and-recur-into-and-conj/</guid><pubDate>Sat, 26 Dec 2020 09:09:08 GMT</pubDate></item><item><title>(clj 4) Learning about when, maps and closures</title><link>https://smallsheds.garden/blog/clojure/2020/clj4-learning-when-maps-closures/</link><dc:creator>Joep Schuurkes</dc:creator><description>&lt;div&gt;&lt;p&gt;It's been more than two months since I did any Clojure - for the obvious reasons. Luckily I did take notes as I proceeded with chapter 3 of "&lt;a href="https://www.braveclojure.com/"&gt;Clojure for the Brave and True&lt;/a&gt;". So the plan is to process these notes into a blog post, which means this post will cover the sections "Data Structures" and "Functions" of that third chapter. Leaving me ready to proceed with the rest of the chapter, i.e. "Pulling It All Together" and the summary and exercises.&lt;/p&gt;
&lt;h3&gt;Why is there a &lt;code&gt;when&lt;/code&gt;?&lt;/h3&gt;
&lt;p&gt;The part about control flow is actually before the part about &lt;code&gt;and&lt;/code&gt; and &lt;code&gt;or&lt;/code&gt; which I talked about in my &lt;a href="https://smallsheds.garden/blog/clojure/2020/clj3-and-or-being-weird/"&gt;previous post&lt;/a&gt;, but according to my notes I returned to it. I don't remember why to be honest.&lt;/p&gt;
&lt;p&gt;The book provides the following example of &lt;code&gt;when&lt;/code&gt;:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;when &lt;/span&gt;&lt;span class="nv"&gt;true&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;println &lt;/span&gt;&lt;span class="s"&gt;"Success!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;"abra cadabra"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;; =&amp;gt; Success!&lt;/span&gt;
&lt;span class="c1"&gt;; =&amp;gt; "abra cadabra"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://smallsheds.garden/blog/clojure/2020/clj4-learning-when-maps-closures/"&gt;Read more…&lt;/a&gt; (7 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>brave clojure</category><category>clojure</category><category>programming</category><guid>https://smallsheds.garden/blog/clojure/2020/clj4-learning-when-maps-closures/</guid><pubDate>Fri, 31 Jul 2020 20:25:15 GMT</pubDate></item></channel></rss>