erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.61k stars 53 forks source link

Improve pattern matching mechanism #460

Closed mtshiba closed 9 months ago

mtshiba commented 9 months ago

This change allows the use of literal and variable patterns together, such as [x, 1] -> ... and so on.

Also, length is now checked in the array pattern and fields are checked in the record pattern.