<div dir="ltr">This is vaguely similar to &quot;if/else and switch as expressions&quot; in the Commonly Proposed list (<a href="https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md">https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md</a>), and probably needs far more justification. (I would argue that it&#39;s worse, since it&#39;s less expressive and, as a statement, cannot be composed.)<div><br></div><div>Austin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 10, 2016 at 4:25 PM, Ross O&#39;Brien 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"><div><span style="font-size:13px">In your example:</span></div><span class=""><div><span style="font-size:13px">a = 5 if b == x</span></div><div><span style="font-size:13px"><br></span></div></span><div>What value is assigned to &#39;a&#39; if &#39;b&#39; and &#39;x&#39; are not equal?</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 10, 2016 at 7:10 PM, MobileSoft (Piotr) 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">I think that should be added new ‘postfix’ if syntax:<br>
a = 5 if b == x<br>
<br>
the code will be better readable. For example:<br>
<br>
a = 5 if b == x<br>
c = 6<br>
d = 8<br>
e = 10 if y == true<br>
f = 12<br>
<br>
in this situation all assigns are on the same, left side.<br>
<br>
regards<br>
piotr<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">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>
</blockquote></div><br></div>
</div></div><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>