Clojure Functions Dealing With Sequences

I am finally through Chapter 3 of Programming Clojure. That chapter deals with sequences and collections (list, map, vector, set, and the Clojure “seq” abstraction), functions common to many types of sequences, and functions that are specific to specific collection types.

I was going to add some of the samples that I went through, but I cannot figure out how to get decent looking Clojure code in WordPress anymore. I do not like the Gutenberg editor at all, and it does now work as well with the classic editor as it used to. I found one called “Enlighter” which sounded good, but it does not do Clojure or any kind of Lisp. Given that WordPress really wants people to use the Gutenberg editor, at some point I might look for something other than WordPress.

The notes are on github (link here). I will update my page listing the functions in the Clojure API (some are in the Set API); I will just point to this page, and if you want to see the examples, then go to the page on Github.

Here are the functions discussed in the notes:

  • assoc
  • cons
  • dissoc
  • drop-while
  • even?
  • every?
  • file-seq (not in notes, in a Clojure file on github
  • filter
  • first
  • for
  • get
  • hash-set
  • interleave
  • line-seq
  • list
  • map
  • next
  • peek
  • pop
  • rest
  • select-keys
  • seq
  • set
  • some
  • split-at
  • split-with
  • subvec
  • take-while
  • vector
  • set/difference
  • set/intersection
  • set/join
  • set/project
  • set/select
  • set/union

Going through this book is taking a while (I admit I don’t do it every day). But I have tried learning languages from koans and puzzles, and I just wind up trying random functions from API and not being very productive.

You’re welcome.

Image from “Grec 74”, a 12th century manuscript housed at the Bibliothèque nationale de France. Source / BnF; image assumed allowed under Public Domain.