3 ms·
I'm clueless about CLOS and just learning Clojure. Corrections solicited, grain of salt, yadda yadda: 1. Clojure already provides multimethods, which can disp
by mnemonicsloth 17y ago
I'm clueless about CLOS and just learning Clojure. Corrections solicited, grain of salt, yadda yadda:
1. Clojure already provides multimethods, which can dispatch CLOS-style, based on number/type of their arguments, or by an arbitrary predicate.
2. To use your wording, while CLOS separates methods from "everything", Clojure multimethods are even separated from classes. Other than being type-aware enough to do dispatch, multimethods are conceptually just functions with some extra testing on the front end.
3. Implementation-wise, things seem to be different. Perusing the links below, it seems the new functionality is intended to preserve dynamism/performance when Java and Clojure objects interact.
4. Grouping functions into logical chunks seems to be the other idea behind protocols.