I really like pattern matching in Rust, but I find myself using it less and less.
`if let` and `let ... else` require substantially less indentation, and I often use them for Option values.
I don't miss this syntactic sugar in OCaml though. Maybe it's just because OCaml has a 2 space indent, unlike Rust's 4 space indent?
miniblog.
Related Posts
Here's a weird UI pattern I haven't seen before. This sanitizer will keep things clean for 24 hours, so the time counts *down*.
Every time I see it, it looks like 24 hour clock showing the wrong time!
Are there any languages that have both pattern matching and statement oriented syntax?
In principle these are orthogonal, but I'm struggling to think of a language with pattern matching that isn't expression oriented.
What piece of syntax has the most different meanings?
I realised today that `as` is extremely overloaded. It can be used for aliasing imports (Python), type casts (Rust), binding pattern match variables (OCaml), type assertions (Hack) and probably many others.
