[swift-evolution] [Pitch] Improving capturing semantics of local functions

Slava Pestov spestov at apple.com
Thu Nov 16 17:00:21 CST 2017



> On Nov 16, 2017, at 2:56 PM, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> the stat suggests that in 90%+ real-life cases [weak self] is used so the "weak func" syntax sugar is worth to consider as an addition to this proposal.
> Slightly OT:
> Just thought about making all captures weak by default… I know it’s probably to late for such a change, but I wonder if this was considered when closures were designed

Remember that only references can be captured weakly, not value types, even if those value types contain reference members… so this might end up being more confusing than necessary.

Slava

> _______________________________________________
> 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/20171116/375436d5/attachment.html>


More information about the swift-evolution mailing list