Report: Clojure Meetup #1
Last Tuesday we held ThoughtWorks’ Australia first Clojure meetup here in Sydney. It was a lot of fun so I thought I’d share a few words about it.
The format was rather simple. First, we had a brief introduction to the language syntax by breaking down a couple of snippets and understanding how each bit worked. For instance, this is one of those snippets:
1 2 3 4 5 6
The cool thing here is that a simple example like this can show quite a few things about Clojure’s syntax:
- Polish notation - this is really the first thing you need to get used to
- Anonymous functions
- The hash map literal and how to use it as a function
- Regular expressions
Add all the natural numbers below one thousand that are multiples of 3 or 5.
It’s the easiest on the site so it allowed us to focus entirely on the language. My first thought was to implement it in an imperative way, but that wouldn’t really teach me anything new so Kurman - the colleague I was pairing with - and I came up with this solution, which I really like:
1 2 3 4
A simple, concise solution that demanded a functional approach. It allowed us to explore Clojure’s APIs and concepts such as lazyness through the use of an infinite sequence. Fun :)
I created a github repository to host this and upcoming solutions from our group. Feel free to browse around.
Can’t wait for our next meetup, when we’ll hack on Overtone!