async/await is now on nightly! We're still waiting on futures 0.3 for it to really be usable, but if you do enough legwork you can test it on the playground: https://play.rust-lang.org/?gist=64948b551d024a89d88cdaee65371a05&version=nightly&mode=debug …
-
-
Replying to @withoutboats
I expect `await!(...)` will become `await ...` at some point?
1 reply 0 retweets 2 likes -
Replying to @Argorak
Yea there's uncertainty about syntax & precedence, most importantly how `await` interacts with `?`
1 reply 0 retweets 3 likes -
-
Replying to @ManishEarth @withoutboats
RFC for an interrobang operator pls? Without jest though: can come up with a lot of questions around ? (or arbitrary returns in await), but what's the precedence problem?
2 replies 0 retweets 4 likes -
Replying to @Argorak @ManishEarth
If we allow ‘await foo?’ do we await first or ? first? You almost definitely want await first, but the ? is more tight syntactically
3 replies 0 retweets 0 likes -
Options include requiring braces: await { foo }?, having a special await? foo syntax and more
3 replies 0 retweets 3 likes
A cool think I like about `await foo()?` is that it makes upgrading from other syntax really straight forward: - foo()? -> await foo()? // sync to async - await foo().unwrap() -> await foo()? // better error handling Also failure's .context() would work well with it.
-
-
though ... `foo await?` also upgrades easily (that doesn't exactly fit well though)
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.