Chapter 5. Multimethods and Protocols
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access