To what benefit?<br><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 15, 2016 at 16:23 Charles Srstka &lt;<a href="mailto:cocoadev@charlessoft.com">cocoadev@charlessoft.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 style="word-wrap:break-word"><blockquote type="cite">On Aug 15, 2016, at 3:08 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:<br></blockquote><div><blockquote type="cite"><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">On Mon, Aug 15, 2016 at 3:05 PM, Charles Srstka<span> </span></span><span dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">&lt;<a href="mailto:cocoadev@charlessoft.com" target="_blank">cocoadev@charlessoft.com</a>&gt;</span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"><span> </span></span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">wrote:</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><span><blockquote type="cite">On Aug 15, 2016, at 2:27 PM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br></blockquote><div><blockquote type="cite"><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">`let value = (x == nil) ? nil : foo.bar(x: x)` isn&#39;t so bad, is it? You could even write a custom operator to sugar it.</span></div></blockquote></div><br></span><div>It’s distasteful, due to the need to use the force-unwrap operator. In cases like this, I usually end up writing:</div><div><br></div><div>let value: Foo? = nil</div><span><div><br></div><div>if let x = x {</div></span><div><span style="white-space:pre-wrap">        </span>value = foo.bar(x: x)</div><div>} else {</div><div><span style="white-space:pre-wrap">        </span>value = nil</div><div>}</div><div><br></div><div>or:</div><div><br></div><div>let value: Foo? = {</div><span><div><span style="white-space:pre-wrap">        </span>if let x = x {</div></span><div><span style="white-space:pre-wrap">                </span>return foo.bar(x: x)</div><div><span style="white-space:pre-wrap">        </span>} else {</div><div><span style="white-space:pre-wrap">                </span>return nil</div><div><span style="white-space:pre-wrap">        </span>}</div><div>}()</div><div><br></div><div>Both of which are unwieldy, but necessary to avoid the use of !.</div></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">You are arguing that the force unwrap operator ! is, per se, distasteful?</div></div></blockquote></div><br></div><div style="word-wrap:break-word"><div>If there are two ways to do something, and one uses the force-unwrap operator while the other does not, I’ll usually opt for the latter.</div></div><div style="word-wrap:break-word"><div><br></div><div>Charles</div><div><br></div></div></blockquote></div>