3 ms·
I don't think "expr await" would be a good choice but that isn't the decision that was made, and I wasn't arguing for it in the first place. TFA says that using
by cyphar 8y ago
I don't think "expr await" would be a good choice but that isn't the decision that was made, and I wasn't arguing for it in the first place. TFA says that using alternative punctuation was decided against because it would lead to line-noise and I don't think there's much more to discuss -- I understand that position and respect it.
My main issue with .await is that it does look method-y rather than keyword-y. But while I like Python's "await expr" syntax in Python the existence of ? and chaining of methods in Rust justifies having a different syntax for it.
- int_19h 8y agoPython also chains methods. And having to write (await (await (await foo).bar()).baz()) is annoying.
- imtringued 8y agoThat doesn't look like well written async code at all... You're not supposed to use await literally everywhere and especially not multiple times in a single line. Javascript already has an answer to this (Hint it was inspired by Monads but it isn't one): await foo.then(f => f.bar()).then(b => b.baz())
- int_19h 8y agoWhat happens if f.bar() throws an exception asynchronously?