An overview of structural pattern matching for Python
An overview of structural pattern matching for Python
Posted May 4, 2022 18:21 UTC (Wed) by jezuch (subscriber, #52988)In reply to: An overview of structural pattern matching for Python by epa
Parent article: An overview of structural pattern matching for Python
> I don’t think there is any language that can easily add new keywords.
There's Java :) Kind of, at least. They've recently added a couple of keywords by using a trick: they're context-dependent. See for example "yield" in the new enhanced switch. The latest proposals of pattern-matching switch go even further, adding "when" keyword as a case guard.
The current design is here: https://openjdk.java.net/jeps/427 As a bonus you can compare it with what is described in the article ;)
