Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

Another solution is provided in Clojure 1.2's protocols which are similar but different: http://clojure.org/protocols



Ah, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: