2 ms·
The source is impressively simple! Good job! I have been implementing a pattern matcher for scheme based on the Balland pattern optimized, and every time I see
by bjoli 6y ago
The source is impressively simple! Good job!
I have been implementing a pattern matcher for scheme based on the Balland pattern optimized, and every time I see pattern matchers for python I always get the feeling that the code you are replacing have to be truly awful for the rather contrived pattern matching syntax to be a net win. Compare any of the python pattern matchers to something like trivia in Common Lisp [0] and you see what I mean.
How do people use the python pattern matchers? I am genuinely curious. One benefit that I see is that you can build patterns at run-time which could be useful.
[0]: https://github.com/guicho271828/trivia/wiki/Type-Based-Destructuring-Patterns https://github.com/guicho271828/trivia/wiki/Type-Based-Destr...