<div dir="ltr">I use local functions heavily in my day-to-day workflow and an very interested in them supporting capture lists.<div>Here is a draft feature specification: <a href="https://bitbucket.org/snippets/lynchrb/r487zn">https://bitbucket.org/snippets/lynchrb/r487zn</a></div><div><br></div><div>Anyone see any weak spots?</div><div><br></div><div>Alex</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 27, 2017 at 12:54 AM, Slava Pestov via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><span class=""><br><blockquote type="cite"><div>On Oct 26, 2017, at 9:53 PM, Howard Lovatt via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_9073212788742473125Apple-interchange-newline"><div><div dir="ltr"><span style="font-size:12.8px">It would be easy to provide a fixit.</span></div></div></blockquote><div><br></div></span>That is still a source breaking change that requires migration, though.</div><div><span class=""><br><blockquote type="cite"><div><div dir="ltr"><span style="font-size:12.8px"> How often are they actually used? I rarely use them and all my use cases could be a closure instead. </span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Also see Mike Kluev example; local functions are arguably worse than closures in all cases (provided that you can appropriately annotate the function type).</div></div></div></blockquote><div><br></div></span><div>Closures cannot replace all uses of local functions. Local functions can be recursive, and have a generic parameter list.</div><div><br></div><div>Slava</div><div><br></div><blockquote type="cite"><div><span class=""><div class="gmail_extra"><br clear="all"><div><div class="m_9073212788742473125gmail_signature" data-smartmail="gmail_signature">  -- Howard.<br></div></div>
<br><div class="gmail_quote">On 27 October 2017 at 12:26, Slava Pestov <span dir="ltr">&lt;<a href="mailto:spestov@apple.com" target="_blank">spestov@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><span><br><div><br><blockquote type="cite"><div>On Oct 26, 2017, at 4:45 PM, Howard Lovatt via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_9073212788742473125m_8201084941564550245Apple-interchange-newline"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Rather than expand local function syntax why not deprecate local functions completely</span></div></blockquote></div><br></span><div>I don’t think at this point such a drastic change to the language is likely to happen.</div><span class="m_9073212788742473125HOEnZb"><font color="#888888"><div><br></div><div>Slava</div></font></span></div></blockquote></div><br></div></span><span class="">
______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></span></div></blockquote></div><br></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div>