<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 Feb 27, 2016, at 9:46 AM, Ross O'Brien &lt;<a href="mailto:narrativium+swift@gmail.com" class="">narrativium+swift@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">How is this different from the rejected ??= proposal?</div><div class="gmail_extra"><br class=""></div></div></blockquote><div><br class=""></div><div>If the value is not nil, the program stops with an assertion error.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 27, 2016 at 2:34 PM, Amir Michail via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Consider the use of “!” in the following:<br class="">
<br class="">
var x: Int? = 5<br class="">
<br class="">
x! = 2 // “!” is used to ensure non-nil value before assignment<br class="">
<br class="">
The idea is to have a similar method for ensuring a nil value.<br class="">
<br class="">
So instead of writing:<br class="">
<br class="">
precondition( x == nil )<br class="">
x = 3<br class="">
<br class="">
You could write:<br class="">
<br class="">
x := 3<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" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>