Skip to main content
Tweeted twitter.com/#!/StackCompSci/status/249297742340448256
edited tags
Link
edited tags
Link
Raphael
  • 72.9k
  • 30
  • 181
  • 393
Source Link
tgoossens
  • 215
  • 2
  • 7

Difference between multimethods and overloading

Context

I've been programming in java for a few years now. And atm i'm learning something totally different: Clojure. There the expression problem can be solved by using multimethods whereas in java you will need something like the visitor pattern or something alike.

The question

I've been reading about multimethods and got quite confused with the actual difference with method overloading.

The only difference I spotted so far that a multimethod doesn't depend on the runtime type of the object on which the method is called.