3 ms·
Serious suggestion, and I assume you have -- have you considered ".await?" as an alternative? It won't conflict with field names and cribs on the fact that "?"
by arcticbull 8y ago
Serious suggestion, and I assume you have -- have you considered ".await?" as an alternative? It won't conflict with field names and cribs on the fact that "?" changes control flow.
- steveklabnik 8y agoYes, it was.
- eridius 8y agoThat conflicts with `.await` + the ? postfix operator. Namely, if `.await` returns a Result, the ? operator could then be used like it is in code today. In fact, this was referenced in the article: > The primary argument in favor of postfix was its better composability with methods and the ? operator.
- arcticbull 8y agoYeah, I thought that through after, and revised my thoughts. I wrote it up top-level but I think the best way forward is embracing that this isn't consistent with anything else in Rust and introducing new syntax, specifically '!await' or '@await' postfix operator. The reason there isn't a good answer that's consistent is that the behavior is inconsistent. As such, it needs new syntax. Either the syntax is inconsistent or the semantics are, and IMO, the former is preferable to the latter.