im v excited to be able to do thispic.twitter.com/B0IsL1OUhO
You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more
TLDR it's for the case where you want to write something like: match (expr) { { done: true, value: v } => (do something with v), _ => { /* noop */ } }
I added a new section on potential future work that includes this (since I think there's enough meat to consider with this proposal as-is). Thanks for bringing it up! I actually think this is p great.https://github.com/zkat/proposal-pattern-matching/blob/master/README.md#if-match …
Yeah it's most definitely not part of v1. But good to keep in mind as a constraint as we're tossing around syntax :)
By the way this proposal is different than mine. With matches the idea is to be an expression so that you can write if (a matches x && b matches y) but don’t want to capture variables. For context, I’m working on a new programming language and this was a very common pattern
A decent amount of use cases for if-let are really if matches. But sometimes you do want to capture variables, no?
Yeah, then you can use if let or match
if-let serves double duty as matches infix but just today I hit a case in rust where a matches infix would have been nice as sugar.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.