Async / Await syntax straw poll

See the paper writeup from the first thread for one possible reason:

The await? construct, proposed to resolve problematic interactions between a prefix await construct and the postfix ? operator, does not have this property of orthogonality. A user who has learned the concept and syntax of ? and of await cannot immediately understand what await? means. await? introduces a new, special-case syntactic usage of ? that doesn’t directly follow from existing developer knowledge of await and ?. Furthermore, it isn’t immediately obvious from the syntax await? foo() whether the ? occurs before or after the await.

Similarly, what expectations might someone have from seeing await? foo()? Would await ?foo() work? (Probably, given our normal tokenizing rules.) Would await (?foo()) work? (Nope, probably not, because it's not a prefix ?, it's a special construct.) Would loop? { ... } work? (I suppose it could? I guess it'd mean loop {...}??)

2 Likes