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

Chapter 7. Dealing with Side Effects

We're going to try and take the data we've generated so far and save it so we can look it up later. In functional programming, reading and writing from the outside world is called a side effect because such an operation does not directly deal with inputs or outputs that are passed into or returned from a function. This goes back to the idea of a pure functional language that's closer to a mathematical expression. The following properties that result from this are more practical in nature:

  • Given the same input, a function will always return the same output.
  • If data from more than one pure function don't depend on each other, their orders can be reversed or they can all be run in parallel.
  • There are other benefits, ...

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