<div>The core team did call it a future &quot;purely additive proposal&quot;--implying that there does need to be one written. I do believe that someone did make a start at implementing compound names, which was not merged as-is because there has been no proposal. Should be an easy and uncontroversial one to write though.</div><div><br></div><div><br><div class="gmail_quote"><div>On Tue, Mar 28, 2017 at 16:27 Karl Wagner &lt;<a href="mailto:razielim@gmail.com">razielim@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div id="m_6053284967331042771edo-message" class="gmail_msg"><div class="gmail_msg">Thanks for that link, it definitely solves the label issue, and even some label issues I didn&#39;t consider; for example, you couldn&#39;t implement BidirectionalCollection using closures without it:<div id="m_6053284967331042771edo-signature" style="font-family:&#39;Helvetica Neue&#39;,&#39;Helvetica&#39;,Helvetica,Arial,sans-serif;font:&#39;-apple-system-body&#39;" class="gmail_msg"></div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">let index: (Index)-&gt;Index // should be index(before:)</div><div class="gmail_msg"><span style="background-color:rgba(255,255,255,0)" class="gmail_msg">let index: (Index)-&gt;Index // should be index(after:)</span></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I&#39;m wondering: if somebody were to implement that amendment , would it require an evolution proposal? Presumably not, since the amendment is part of the condition under which SE-0111 was accepted, right?</div></div></div><div class="gmail_msg"><div id="m_6053284967331042771edo-message" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Karl</div><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div class="gmail_msg"><div id="m_6053284967331042771edo-original" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" style="margin:1ex 0 0 0;border-left:1px #ccc solid;padding-left:0.5ex" class="gmail_msg"><div class="gmail_msg">On Mar 26, 2017 at 10:11 pm, &lt;<a href="mailto:xiaodi.wu@gmail.com" class="gmail_msg" target="_blank">Xiaodi Wu</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I&#39;m in favor of both of these.<br class="gmail_msg"><br class="gmail_msg">However, the issue outlined in (1) with respect to labels is problematic. The core team&#39;s post-Swift 3 plan (<a href="https://lists.swift.org/pipermail/swift-evolution-announce/2016-July/000233.html" class="gmail_msg" target="_blank">https://lists.swift.org/pipermail/swift-evolution-announce/2016-July/000233.html</a>) for evolving from SE-0111 solves that problem without the need to invent new rules for (1). IMO, that issue should be addressed first, then (1).<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">On Sun, Mar 26, 2017 at 14:04 David Sweeris via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">On Mar 26, 2017, at 11:12, Karl Wagner via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br class="gmail_msg"><br class="gmail_msg"></div><blockquote type="cite" class="gmail_msg">I’d like to pitch the following two language changes. Both of them are technically possible today if you manually write thunks for the relevant protocol requirements, but it would be nice if we allowed them to be written directly:<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">1) Allow closures to satisfy function requirements in protocols</div><div class="gmail_msg"><br class="gmail_msg"></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg"><div class="gmail_msg"><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;color:rgb(36,41,46)" class="gmail_msg"><span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">protocol</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">MyProtocol</span> {
    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">func</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">run</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-smi gmail_msg" style="box-sizing:border-box;color:rgb(51,51,51)">param</span>: <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">Int</span>) <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">-&gt;</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>
}

<span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">struct</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">MyStruct</span> : <span class="m_6053284967331042771m_-1316733808039533553pl-e gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">MyProtocol </span>{
    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">var</span> run <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">:</span> (<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">Int</span>)<span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">-&gt;</span><span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">String</span>   <span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box">//</span> Satisfies requirement MyProtocol.run</span>
<span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"></span>}</pre><div class="gmail_msg"><br class="gmail_msg"></div></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg">Among other things, it would make writing type-erased wrappers in the style of AnyCollection much easier. The only obvious niggle is that the argument label wouldn’t be required when invoking the closure directly. The labels have no type-system significance, but it does make it subtly easier to write less generic code than you intend do. We could solve this by having code-completion favour protocol methods in this situation, or simply to require the label when invoking a closure which implements a known protocol requirement.</blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></blockquote>2) Allow functions with default parameters to satisfy function requirements in protocols<div class="gmail_msg"><br class="gmail_msg"></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class="gmail_msg"><div class="gmail_msg"><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;color:rgb(36,41,46)" class="gmail_msg"><span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">protocol</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">Sportsplayer</span> {
    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">func</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">goalsScored</span>() <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">-&gt;</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">Int</span>
}

<span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">struct</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">SoccerPlayer</span>: <span class="m_6053284967331042771m_-1316733808039533553pl-e gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">Sportsplayer </span>{
    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">struct</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">GoalType</span> : <span class="m_6053284967331042771m_-1316733808039533553pl-e gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">RawOptionSet </span>{
        <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">static</span> <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> Shot   <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">GoalType</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">0x1</span>)
        <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">static</span> <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> Volley <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">GoalType</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">0x10</span>)
        <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">static</span> <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> Header <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">GoalType</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">0x100</span>)
        <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">static</span> <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">Any</span>    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">GoalType</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">0x111</span>)
    }

    <span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box">//</span> Default value .Any means this conforms to Sportsplayer</span>
<span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"></span>    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">func</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">goalsScored</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-smi gmail_msg" style="box-sizing:border-box;color:rgb(51,51,51)"><span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">type</span></span>: GoalType <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> .<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">Any</span>) {
      <span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box">//</span>...</span>
<span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"></span>    }
}

<span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">struct</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">Footballer</span>: <span class="m_6053284967331042771m_-1316733808039533553pl-e gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">Sportsplayer </span>{
    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">struct</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">GoalType</span> : <span class="m_6053284967331042771m_-1316733808039533553pl-e gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">RawOptionSet </span>{
        <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">static</span> <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> Touchdown <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">GoalType</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">0x1</span>)
        <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">static</span> <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> FieldGoal <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">GoalType</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">0x10</span>)
        <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">static</span> <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">Any</span>       <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">GoalType</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">0x11</span>)
    }

    <span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box">//</span> Default value .Any means this conforms to Sportsplayer</span>
<span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"></span>    <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">func</span> <span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">goalsScored</span>(<span class="m_6053284967331042771m_-1316733808039533553pl-smi gmail_msg" style="box-sizing:border-box;color:rgb(51,51,51)"><span class="m_6053284967331042771m_-1316733808039533553pl-en gmail_msg" style="box-sizing:border-box;color:rgb(121,93,163)">type</span></span>: GoalType <span class="m_6053284967331042771m_-1316733808039533553pl-k gmail_msg" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> .<span class="m_6053284967331042771m_-1316733808039533553pl-c1 gmail_msg" style="box-sizing:border-box;color:rgb(0,134,179)">Any</span>) {
      <span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box">//</span>...</span>
<span class="m_6053284967331042771m_-1316733808039533553pl-c gmail_msg" style="box-sizing:border-box;color:rgb(150,152,150)"></span>    }
}</pre><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_msg">I often find that I want to add some optional, implementation-specific parameter to a function which implements a protocol requirement. That’s currently not possible, and it’s a bit annoying.</div></blockquote></blockquote><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">IIRC, the issue with #2 is that protocols specify declaration-site details, but default parameters are implemented at the call-site. At least I believe that statement was accurate about a year(ish) ago... Dunno if anything has changed since then.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">If it can be made to work, though, I&#39;d be in favor of it, and I think #1 as well.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Dave Sweeris</div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>
</div></blockquote></div></div></div></blockquote></div></div>