[swift-evolution] An upcoming proposal for simplifying leak free, safe closures.
Charlie Monroe
charlie at charliemonroe.net
Mon Jun 27 00:22:29 CDT 2016
> All object references used within a closure must unwrap successfully for the closure to execute.
I agree with the logic of this proposal, but this is the confusing part or a part that I slightly disagree with.
By this logic, the block won't be invoked if all captured variables can't be unwrapped, which is definitely confusing to the newcomer (to whom this is partially targetted as you've mentioned) if he puts a breakpoint in it and doesn't get executed even when he's explicitely invoking it somewhere.
On the other hand, when it crashes, it gives him some idea that something's wrong.
>
> I believe that these are safe, sensible and understandable rules that will eliminate the need for capture lists for many closures. What do you think?
>
>
> _______________________________________________
> 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/20160627/9027222b/attachment.html>
More information about the swift-evolution
mailing list