[swift-evolution] An upcoming proposal for simplifying leak free, safe closures.
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution