We now have a better understanding of how Clojure works; we understand how to perform simple operations with immutable data structures but we are missing some features that could make our lives much easier.
If you have been a Java programmer for a while, you are probably thinking about polymorphism and its particular flavor in Java.
Polymorphism is one of the concepts that enable us to reuse a code. It gives us the ability to interact with different objects with the same API.
Clojure has a powerful polymorphism paradigm that allows us to write simple code, create code that interacts with types that don't exist yet, and extend code in ways it wasn't devised for when a programmer wrote it.
To help us with polymorphism in Clojure, we have two important concepts that we will cover in this chapter:
Multimethods
Protocols
Each of them has its own use cases and things it is best at; we will look into them in the next section.
We will learn each of these different concepts...