Open jakebolewski opened 9 years ago
Yes, the lattice example might not be too relevant. I was hoping it would end up dynamically-typed, but as-is it is merely object oriented. Curious to hear what Alan has to say about it.
I think to talk about the advantages of "dynamic dispatch" there has to be a distinction made between single dispatch vs asymmetric multiple dispatch (static & dynamic), and symmetric multiple dispatch (static & dynamic). It is quite hard to come up with a motivating example that can't be recast into one of the other systems.
It would be interesting to see a comparison of single dispatch vs asymmetric multiple dispatch vs symmetric multiple dispatch. I think you need to motivate why symmetric multiple dispatch was chosen.
Best I can think of is commutative operators, where it just doesn't make sense to pick one argument as the winner. Also relevant is the ability to compute the intersection: showing this to the programmer sometimes reveals a case they forgot to handle, and resolving left-to-right would just hide the issue.
You address this with your Animal example, but don't explicitly call it the "binary method problem" which is oft referenced in the literature (you include one of the Castagna papers in the reference section). I don't know if the lattice example you give (to give a more "technical computing" exploration of the problem) is the best motivating example. @alanedelman, you might want to chime in here with the specific questions you had today about this specific example.