3 ms·
Neither do I if I can avoid it, I use type hierarchies and generic methods. Unfortunately it's not very popular; the only supporting languages I know of are Co
by codr7 7y ago
Neither do I if I can avoid it, I use type hierarchies and generic methods.
Unfortunately it's not very popular; the only supporting languages I know of are Common Lisp, Julia & Perl 6.
I've designed and implemented several scripting languages [0] over the years, but they all have this pattern in common, I've never felt tempted to implement classes.
[0] https://github.com/codr7/gfoo https://github.com/codr7/gfoo
- jbjohns 7y agoDylan also supports it and it can be done in Python with a library [1]. I don't know if you'd count it but it's also straight forward in Haskell [2] at the type class level. [1] https://en.wikipedia.org/wiki/Multiple_dispatch#Python https://en.wikipedia.org/wiki/Multiple_dispatch#Python [2] https://stackoverflow.com/questions/26303353/can-multiple-dispatch-be-achieved-in-haskell-with-pattern-matching-on-type-class https://stackoverflow.com/questions/26303353/can-multiple-di...
- lizmat 7y agoPlease note that Perl 6 has been renamed to Raku (https://raku.org https://raku.org using the #rakulang tag on social media). If you want to stay up-to-date with events in the Raku world, check out the Rakudo Weekly News: https://rakudoweekly.blog https://rakudoweekly.blog