• gobdovan 4 hours ago

    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.

    [0] https://en.wikipedia.org/wiki/Expression_problem

    [1] https://craftinginterpreters.com/representing-code.html

    • fungiblecog an hour ago

      if only programmers cared about functionality as much as syntax we'd be living in a lisp heaven

      • 3cats-in-a-coat an hour ago

        You need some sort of critical majority that cares about deeper aspects of whatever (over superfice) or else everyone focuses on superfice, as that's what all the public debates are about.

        But lacking that, lisp could improve its syntax (did that, BTW not hard, just added some containers and a few standard infix operators, which all compile to lists).

      • lisper 5 hours ago

        Cue the smug Common Lisp weenies...

        Oh, wait, that's me :-)

        • andsoitis 5 hours ago

          Part 3 of this series discusses Common Lisp - https://eli.thegreenplace.net/2016/a-polyglots-guide-to-mult...

          • adgjlsfhk1 3 hours ago

            don't worry. the Julia peeps can also be smug about this (as one)

            • upghost 4 hours ago

              To your point, I assume the "polyglot" part was referring to the arguments this would spawn in the comment section