<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 10, 2016, at 9:22 PM, Donnacha Oisín Kidney &lt;<a href="mailto:oisin.kidney@gmail.com" class="">oisin.kidney@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think that syntax already exists:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> x = <span style="font-variant-ligatures: no-common-ligatures; color: #312cdd" class="">2</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span> (<span style="font-variant-ligatures: no-common-ligatures; color: #312cdd" class="">1</span>...<span style="font-variant-ligatures: no-common-ligatures; color: #312cdd" class="">3</span>).<span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">contains</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">x</span>) { <span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">print</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #312cdd" class="">1</span>) }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> ar: [<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span>?] = [<span style="font-variant-ligatures: no-common-ligatures; color: #312cdd" class="">1</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #312cdd" class="">2</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">nil</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #312cdd" class="">4</span>]</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class="">for<span style="" class=""> </span>case<span style="" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">x</span><span style="" class="">? </span>in<span style="" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">ar</span><span style="" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(61, 29, 129);" class=""><span style="" class="">&nbsp; </span>print<span style="" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">x</span><span style="" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div></div></div></div></blockquote><div><br class=""></div><div>I think what I proposed might be a more intuitive replacement for the existing “if case” and “for case”.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 11 Jan 2016, at 00:58, Amir Michail via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Examples:<br class=""><br class="">if switch x case 1…3 { … }<br class=""><br class="">for switch x case .Some(_) in args { print(x!) &nbsp;}<br class=""><br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>