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

Basic Clojure functions and immutability

There are many operations we can perform over our result list (or lazy sequence). One of the main approaches of functional programming (FP) is to take a data structure and perform operations over it to produce a new data structure or atomic result (such as a string, number, and so on). This may sound inefficient at first. However, most FP languages employ something called immutability to make these operations efficient. Immutable data structures are those that cannot change once they've been created. This is feasible as most immutable FP languages use some kind of structural data sharing between an original and a modified version. The idea is that if we run evaluate (conj [1 2 3] 4), the resulting [1 2 ...

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