February 2018
Intermediate to advanced
304 pages
7h 11m
English
Multimethods are extremely flexible, and with that flexibility comes choices. How should you choose when to use multimethods, as opposed to some other technique? We approach this question from two directions, asking the following:
The most striking thing is that multimethods are rare—about one per 1,000 lines of code. So don’t worry that you’re missing something important if you build a Clojure application with few, or no, multimethods. A Clojure program that defines no multimethods isn’t nearly as odd as an object-oriented program with no polymorphism.
Many multimethods dispatch on class. Dispatch-by-class is the easiest ...