A Small Bit of Clojure Enlightenment

I have started looking at Clojure. I think it can handle concurrency well, I think functional programming will become more important, and I think all roads lead to Lisp.

I started out by looking at some of the short introductions and tutorials on the Clojure subreddit.

Lisp variants actually have less punctuation than other languages, yet they can still be a bit hard to get used to.

I had a bit of enlightenment about anonymous functions. I could not see where they would be used. One of the tutorials said you would use then when you need a function that you might use only once.

Then I noticed that the tutorials seemed to use them as arguments to the “collection functions”, like map, reduce, filter, remove, split-with. Those functions take a function and a collection as arguments. I noticed that those functions were a common place to use anonymous functions.

You’re welcome.

Image from World Digital Library, assumed allowed under Fair Use. Image from the Ashburnham Pentateuch, or Tours Pentateuch, a Latin manuscript of the first five books of the Old Testament from the 6th century or 7th century. Its place of origin is unknown.