O'Reilly logo

Clojure for Finance by Timothy Washington

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A review of collections

We introduced the Clojure collection types in Chapter 1, Orientation – Addressing the Questions Clojure Answers, and Chapter 3, Developing the Simple Moving Average. They are all immutable with sequences having the extra facility of laziness. Let's review what we know so far:

  • Lists: These are data structures that are surrounded by the () parentheses. Unquoted, lists evaluate functions in a list's head position (myfn 1 2 3). Any number of arguments can follow after the head. Quoted, lists are simply data. They can contain any value type '(1 2 3 myfn :fubar).
  • Vectors: These are data structures with efficient random access, where list's efficient point of access is its head. Vectors are written with two opposing square brackets, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required