▲ | A polyglot's guide to multiple-dispatch (2016)(eli.thegreenplace.net) | |
71 points by andsoitis 6 days ago | 6 comments | ||
▲ | Panzerschrek 3 days ago | parent | next [-] | |
As I know C++ now allows multiple dispatch for std::variant: https://en.cppreference.com/w/cpp/utility/variant/visit2.htm.... And std::variant is now a better choice for cases like in the article above, where previously inheritance was used to represent a closed set of possible subtypes. | ||
▲ | gobdovan 3 days ago | parent | prev | next [-] | |
This is a nice illustration of the expression problem, which the article itself points out toward the end. Multiple dispatch is a language-level way to solve it. Crafting Interpreters [1] has a very approachable Java-based chapter that also covers these patterns in detail. | ||
▲ | ur-whale 2 days ago | parent | prev | next [-] | |
Would have been nice to mention that it's one thing that Julia seem to have gotten right. | ||
▲ | fungiblecog 3 days ago | parent | prev | next [-] | |
if only programmers cared about functionality as much as syntax we'd be living in a lisp heaven | ||
▲ | eliben 2 days ago | parent | prev | next [-] | |
Thanks for posting this! Just a quick note that this post is the first in a series: see https://eli.thegreenplace.net/tag/multiple-dispatch for the full series | ||
▲ | lisper 3 days ago | parent | prev [-] | |
Cue the smug Common Lisp weenies... Oh, wait, that's me :-) |