April 2012
Intermediate to advanced
296 pages
7h 3m
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 approached 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 are missing something important if you build a Clojure application with few, or no, multimethods. A Clojure program that defines no multimethods is not nearly as odd as an object-oriented program with no polymorphism.
Many multimethods dispatch on class. Dispatch-by-class is the ...
Read now
Unlock full access