© 2021 Strange Loop
If you've done much work in any language with polymorphism, you've probably encountered the expression problem, whether you knew its name or not. Chances are even come up with a solution or two yourself. I'll define the expression problem, demonstrate some common solutions, then dig into how Clojure's multimethods and protocols each solve the problem while avoiding weaknesses of other solutions. Along the way you'll get a sense of how Clojure's approach to datatypes differs from classic object-oriented languages.