[swift-evolution] [Concurrency] async/await + actors

David Hart david at hartbit.com
Sun Aug 20 00:09:42 CDT 2017

> On 20 Aug 2017, at 01:17, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
>> On Aug 19, 2017, at 8:14 AM, Karim Nassar via swift-evolution <swift-evolution at swift.org> wrote:
>> This looks fantastic. Can’t wait (heh) for async/await to land, and the Actors pattern looks really compelling.
>> One thought that occurred to me reading through the section of the "async/await" proposal on whether async implies throws:
>> If ‘async' implies ‘throws' and therefore ‘await' implies ‘try’, if we want to suppress the catch block with ?/!, does that mean we do it on the ‘await’ ? 
>> guard let foo = await? getAFoo() else {  …  }
> Interesting question, I’d lean towards “no, we don’t want await? and await!”.  My sense is that the try? and try! forms are only occasionally used, and await? implies heavily that the optional behavior has something to do with the async, not with the try.  I think it would be ok to have to write “try? await foo()” in the case that you’d want the thrown error to turn into an optional.  That would be nice and explicit.

That seems like an argument in favor of having async and throws as orthogonal concepts.

> -Chris
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170820/0571cc1e/attachment.html>

More information about the swift-evolution mailing list