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

Thorsten Seitz tseitz42 at icloud.com
Mon Nov 20 23:50:51 CST 2017



> Am 21.11.2017 um 04:00 schrieb Chris Lattner via swift-evolution <swift-evolution at swift.org>:
> 
> 
>> On Nov 12, 2017, at 8:52 PM, Slava Pestov via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> 
>> func fn<T>(param: T) throws -> T where T : Equatable [foo, bar] { … }
> 
> +1, potentially adding a context sensitive keyword like “capturing” before it.

+1 including the keyword "capturing"

-Thorsten

> 
>> I think #4 is ambiguous with array literals unfortunately.
>> 
>> Perhaps this proposal should be split in two — the ‘self.’/escaping part is source breaking, and will likely require more discussion. Adding capture lists to local functions seems like a more straightforward change.
> 
> +1.
> 
> -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/20171121/5f1a4bfa/attachment.html>


More information about the swift-evolution mailing list