4 ms·
http://en.wikipedia.org/wiki/Multiple_dispatch#Common_Lisp http://en.wikipedia.org/wiki/Multiple_dispatch#Common_Lisp I tend to prefer the (defmethod) form in
by agentultra 15y ago
http://en.wikipedia.org/wiki/Multiple_dispatch#Common_Lisp http://en.wikipedia.org/wiki/Multiple_dispatch#Common_Lisp
I tend to prefer the (defmethod) form in CL. You get generic functions which can retrieve the function object specialized for the parameters with (find-method). You also get the auxiliary method goodness...
But the great thing with Python that the article shows is that there's probably a way you can get those things in Python too if you needed them.
So does Python have multiple dispatch or can you just implement it?
- swannodette 15y agoThe challenge with expressive features like multimethods - does your language give you the tools not only to implement it, but to make it fast? This is yet another benefit of macros - the ability to add features like this and get good, perhaps even great, performance.