© Mark McDonnell 2017

Mark McDonnell, Quick Clojure, https://doi.org/10.1007/978-1-4842-2952-1_3

3. Functional Programming

Mark McDonnell

(1)southend-on-Sea, UK

Clojure is a functional language, so it provides certain features you would expect to find in other functional programming (FP) languages, such as the following:

  • Immutability

  • Referential transparency

  • First-class functions

  • Partial application

  • Recursive iteration

  • Composability

Let’s take a moment to consider each of these features.

Immutability

The idea behind immutability is that it is used when we wish to avoid “mutating state .” What that really means is that it helps us to avoid changing data that might be used by multiple (separate) areas of a program.

If you have state and it can change, ...

Get Quick Clojure: Effective Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.