Or, how to read cryptic documentation and make sense of it

Lines of text from a book
Lines of text from a book
Photo by J-S Romeo on Unsplash

Recently I came across a rant on Reddit about clojure’s unfriendly documentation. One example mentioned is the documentation of for. The official doc reads as follows:

List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr …], :while test, :when test.

(take 100 (for [x (range 100000000) y (range 1000000) :while (< y x)] [x y]))


Yizhe Sun

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store