O'Reilly logo

Clojure: High Performance JVM Programming by Akhil Wali, Shantanu Kumar, Eduardo Díaz

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

Specific collection types in Clojure

Now that you know about Clojure's general collection properties and the sequence abstraction, it is a good time to get to know about Clojure's specific collection implementations.

Vectors

Vectors are Clojure's workhorse; together with map, it is the most used collection. Don't be afraid of them; they have nothing to do with Java's java.util.Vector. They are just a series of ordered values, such as a list or an array.

They have the following properties:

  • They are immutable
  • They can be accessed sequentially
  • They are associative (they are maps of their indices, meaning that their keys are 0, 1, 2, and so on)
  • They are counted, meaning they have a finite size
  • They have random access, so you can access any element with almost ...

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