<div dir="ltr">Regarding the &quot;some-day&quot; list (or &quot;deferred&quot; proposals): It has been discussed many times before, and Chris also agreed that it would be useful[1], but nobody seems to have made it happen. So I have created a trello board:<br><a href="https://trello.com/b/dkVHvhGn/swift-deferred-proposals">https://trello.com/b/dkVHvhGn/swift-deferred-proposals</a><br><br>Hopefully we can maintain it collectively, and it should be a handy 
quick reference to previous discussions about specific subjects. I&#39;ve added a few lists/cards to get started, including a link to this discussion about pattern matching. There&#39;s a README on the board that contains a link to gain add/edit access to the board.<br><div><br>[1] <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160926/027353.html">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160926/027353.html</a><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 23 Dec 2016 at 04:38 David Sweeris via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Dec 17, 2016, at 9:43 PM, Mathew Sanders via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_4078011008653467476Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small" class="gmail_msg">I&#39;ve just joined the list (hi!) so not sure if this has been discussed in the past.</span><br class="gmail_msg"></div><div style="margin:0px;line-height:normal" class="gmail_msg"><br class="gmail_msg"></div><div style="margin:0px;line-height:normal" class="gmail_msg">Curious to hear if a future version of Swift might ever include some sort of pattern-matching extended to Arrays. Maybe something like the following:</div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg"><br class="gmail_msg"></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> numbers: [</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)" class="gmail_msg">Int</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">]</span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">        </span><br class="m_4078011008653467476webkit-block-placeholder gmail_msg"></p><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">switch</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> numbers {</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">case</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> []:</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><font class="gmail_msg" color="#008400">    // to match an empty array</font></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">            </span><br class="m_4078011008653467476webkit-block-placeholder gmail_msg"></p><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">case</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> [</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)" class="gmail_msg">1</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)" class="gmail_msg">2</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)" class="gmail_msg">3</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">]:</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><font class="gmail_msg">    </font><font class="gmail_msg" color="#008400">// to match array with specific values</font></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">            </span><br class="m_4078011008653467476webkit-block-placeholder gmail_msg"></p><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">case</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> [</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">_</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">_</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">_</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">]:</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><font class="gmail_msg">    </font><font class="gmail_msg" color="#008400">// to match array with 3 Ints</font></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">            </span><br class="m_4078011008653467476webkit-block-placeholder gmail_msg"></p><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">case</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> [first</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">, last]:</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><font class="gmail_msg">    </font><font class="gmail_msg" color="#008400">// match a 2 element array and bind first and last elements</font></span></div><p style="margin:0px;font-size:11px;line-height:normal;font-family:menlo;min-height:13px" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">            </span><br class="m_4078011008653467476webkit-block-placeholder gmail_msg"></p><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="color:rgb(186,45,162);font-variant-ligatures:no-common-ligatures" class="gmail_msg">case</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> </span><span style="color:rgb(186,45,162);font-variant-ligatures:no-common-ligatures" class="gmail_msg">let</span><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"> [first, next...]:</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><font class="gmail_msg">    </font><font class="gmail_msg" color="#008400">// to match array with at least one element</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><font class="gmail_msg">    </font><font class="gmail_msg" color="#008400">// bind first element, and bind other elements (could be empty)</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg"><font class="gmail_msg">    </font><font class="gmail_msg" color="#008400">// first: Int, next: [Int]</font></span><span class="gmail_msg">            </span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:menlo" class="gmail_msg"><span style="font-variant-ligatures:no-common-ligatures" class="gmail_msg">}</span></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I love the pattern matching on tuples, and would love to see if extend to Arrays as well, but not sure if it fits with future goals for the language.</div></div></div></blockquote></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"></blockquote></div><br class="gmail_msg"><div class="gmail_msg">+1</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Also, +1 for Erica’s idea of a “some day” list</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></div>