Hacker News new | past | comments | ask | show | jobs | submit login

The example absolutely can be done with conditional expressions (`x if y else z`). But each `case` of a `match` can execute arbitrary imperative logic (like `return`, `raise` etc.); a "match expression" syntax would have to support much less, and it's hard to imagine how it would gain any benefit over the existing conditional expression syntax.





Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: