Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

C# and Swift have pattern matching.


It's more limited than what you'd ideally want: pattern matching in function definitions. This makes walking ASTs a breeze.

Edit: And inline pattern matching for values returned from expressions and function calls (similar to destructuring, but more powerful).


I would say what C#11 does is already quite good, likewise for Swift.

Perfection is the enemy from good.

Those I can use at work, ML derived languages not, even F# is an uphill battle in most shops.




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

Search: