<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 31 Oct 2016, Xiaodi Wu wrote:</div><br class="Apple-interchange-newline"><div class="">Don't we currently have "for x in y" and "for var x in y"? So, we could have "unwrap x" and "unwrap var x".<br class=""><br class="">And since unwrap wouldn't allow arbitrary Boolean expressions at the front like if and guard statements do, it could use the where clause like for loops do.<br class=""></div></blockquote></div><br class=""><div class="">You're right. I'd forgotten about that. I found out you can even place the `<b class=""><font face="Menlo" class="">var</font></b>` keyword inside a tuple pattern where only one variable is going to be modified locally:</div><div class=""><br class=""></div><div class=""><span style="font-family: Menlo;" class=""> <b class="">for</b> (<b class="">var</b> i, c) <b class="">in</b> <font color="#791a3e" class="">"foobar"</font>.characters.enumerated() {</span></div><div class=""><font face="Menlo" class=""> i += 1 <font color="#919191" class="">// pretty contrived example</font></font></div><div class=""><font face="Menlo" class=""> print(i, c)</font></div><div class=""><font face="Menlo" class=""> }</font></div><div class=""><br class=""></div><div class="">— Pyry</div><div class=""><br class=""></div></body></html>