|
|
|
|
|
by phunge
3716 days ago
|
|
Ooh Python! Check out https://github.com/mrocklin/multipledispatch which is a little more fleshed out than Guido's implementation. From the author of toolz and dask so you know it's good ;) I also find that multiple dispatch is something that's occasionally handy, but single dispatch is truly everywhere. I think if you broke down multipledispatch uses in languages which embrace it (e.g. CLOS), the mix is like 95% single, 5% >single. For single dispatch in python, check out https://docs.python.org/3/library/functools.html#functools.s... which was added in to the Python 3.4 stdlib. The alternative is the OOP subclassing style, which works but IMHO isn't very readable. |
|
Operators in Perl 6 are all MD, so that's likely a significant factor.
Additionally it is well designed. While the functionality starting point was CLOS, the UX has the benefit of hindsight and a decade of non-stop language evolution.
[1] https://github.com/rakudo/rakudo/tree/nom/src/core