every time i see people attribute match statements to rust i get annoyed. that shit’s been around fur a very, very long time
@aescling I'm looking this up, the doc page for Rust By Example even says its like C's switch/case lol
[ flashbacks to learning C++ in university lmao ]
@packetcat depending on your audience that’s not the worst comparison but the kinds of patterns you can write cases fur are much more expurressive than C and you also have the conceptual overhead of implicit binding and destructuring, and you also get the benefit of exhaustiveness checking (though C compilers can sometimes kinda do that these days if you ask them to)
i know if from OCaml (whose pattern matching semantics are more or less what Rust uses, from what i understand) but the concept purredates ML by arguably decades, depending on what exactly you categorize as “pattern matching”