<div dir="ltr"><div><div><div><div>There’s already<br><br></div><span style="font-family:monospace,monospace">a = a ?? []</span><br><br></div>which is a shorthand for<br><br></div><span style="font-family:monospace,monospace">a = a ? a : []</span><br><br></div>For some reason I find it slightly weird to see <span style="font-family:monospace,monospace">?=</span> but that might just be because I’m not used to seeing it.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 15, 2015 at 11:53 PM, James Campbell 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 dir="ltr">Would be great to have a ?= syntax.<div><br></div><div>So if</div><div><br></div><div>var a: [String]? is nil then</div><div><br></div><div>a ?= [] </div><div><br></div><div>will set it with a new array but if it already has a value then it won&#39;t do anything :)/</div><span class="HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><span style="font-size:16px;line-height:19.2px"></span><span style="font-size:12.8px"> Wizard</span><br></div><div><a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a></div><div><a href="tel:%2B44%207523%20279%20698" value="+447523279698" target="_blank">+44 7523 279 698</a></div></div></div></div></div></div>
</div></font></span></div><span class="HOEnZb"><font color="#888888">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=KlmFWKNIEcyPEGx2Wqruu-2FaM6I0anrxIOlKS1pgqec65rjZdh6or-2FkfTFBD8wm-2FcA1T3KK8fZCGl2tkjqUbWXbBCquO2FKE5bRFXngP-2FmxS-2FhCqCq-2BF3Q5AGZwafHHrV7wPLc6bvlprJUkR01PxbtcG-2FPW6R-2FtbeHvA0I2pCd9TX-2FnGqCre-2FDlhoJxuz0gSjuSFoo1vIl2XIqBktNAKOpJBqnET0lmMvJv10bmuLqjI-3D" alt="" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" height="1" border="0" width="1">
</font></span><br>_______________________________________________<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/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>