JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

Change match syntax #112

Closed JSAbrahams closed 5 years ago

JSAbrahams commented 5 years ago

Current Issue

Currently match is a bit verbose, as writing match <expression> with ... is a bit cumbersome. In particular the with keyword, which is used nowhere else and serves no real purpose here.

High-level description of the feature

It might be better to do it like this: <expression> match ..., with ... being the match arms. This is similar to how Scala does it and to my eye a more elegant way to write match expressions.

Description of potential implementation

Remove with keyword, and make match a postfix function.