The example in the article I wrote is achieving polymorphic dispatch using protocols, so protocols are much better than OOP for solving this specific problem.
Pattern matching in elixir doesn’t get you everything you need to solve the expression problem. You also need to be able to extend the patterns that you can match on, dynamically. Meaning the patterns you match on need to be extensible. The only way you can achieve this is with protocols AFAIKT






















