|
|
|
|
|
by KingMob
3878 days ago
|
|
Just a slight addendum: Clojure multimethods can resolve to a concrete method implementation based on any function of their parameters. So, in addition to single dispatch based on class (a la Java), you could also dispatch based on the classes of multiple parameters or on the value of the field 3 objects deep. |
|
This means that you can do something like
but the following won't really work how you want it to: You could, however, define something based on class and not isa? via your dispatch function: