4 ms·
Clojure actually does support (multiple, open) type hierarchies (with preferences) for dispatching on type. This example just doesn't use them. Lots more info
by puredanger 16y ago
Clojure actually does support (multiple, open) type hierarchies (with preferences) for dispatching on type. This example just doesn't use them. Lots more info here: http://clojure.org/multimethods http://clojure.org/multimethods
Another solution is provided in Clojure 1.2's protocols which are similar but different: http://clojure.org/protocols http://clojure.org/protocols
- barrkel 16y agoAh, I see. I had thought that a single dispatcher value was required; but I see that a list of them is acceptable, and Clojure then uses the more regular means on that, rather the original list of arguments. Then, the point of the dispatching function - which is what it's called in the Clojure docs - is rather a classifier function, rather than dispatcher.