<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=""><div class="">Specifically on this point:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">The use of 'then' is more of a modifier to the 'if' statement than a keyword so it should be&nbsp;possible to allow the use of then in the same way&nbsp;'let required = 1 ; let convenience = 1'&nbsp;is legal in&nbsp;swift.&nbsp;</div></blockquote><div class=""><br class="">We can get away with this because 'required' and 'convenience' only appear in a type, where arbitrary expressions are not allowed. In this case, 'then' is a separator between two expressions. We can probably recover if the user forgets it, but only if it's a true keyword.</div><div class=""><br class=""></div><div class="">I'll repost what I said on another thread:&nbsp;when adding new syntax, it's important to consider not just complete, correct code, but also the possible error and intermediate states that the compiler and SourceKit have to deal with.</div><div class=""><br class=""></div><div class="">Jordan<br class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 15, 2015, at 8:38 , J. Cheyo Jimenez via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Thank you Paul for the initial draft.&nbsp;<div class=""><br class=""></div><div class="">Here is the a draft version that I intend to submit.&nbsp;<br class=""><div class=""><br class=""></div><div class=""><a href="https://github.com/masters3d/swift-evolution/blob/ReplaceTernary/proposals/00-Replace%20%3F:%20Ternary%20Operator%20with%20if-then-else%20expression.md" class="">https://github.com/masters3d/swift-evolution/blob/ReplaceTernary/proposals/00-Replace%20%3F:%20Ternary%20Operator%20with%20if-then-else%20expression.md</a><br class=""><br class="">On Monday, December 14, 2015, Paul Ossenbruggen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><blockquote class="gmail_quote" style="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;" class="">Agreed, I was thinking to I really want turn something that was 2 characters into 10 and will I really be happy with that at the end of the day. A properly formatted ternary can be quite easy to read, it is when people get sloppy and try to cram too much into one expression that they get really hard to follow. For example,<div class=""><br class=""></div><div class=""><div class=""><font color="#222426" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif" size="2" class=""><span style="white-space: pre-wrap;" class="">&nbsp; &nbsp; return (a&lt;b) ? (b&lt;c) ? b : (a&lt;c) ? c : a : (a&lt;c) ? a : (b&lt;c) ? c : b;</span></font></div><font color="#222426" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif" size="2" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><font color="#222426" size="2" class=""><span style="white-space: pre-wrap;" class="">If formatted like this becomes easier follow the logic (at least to me):</span></font></div><div class=""><span style="color: rgb(34, 36, 38); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; font-size: small; white-space: pre-wrap;" class=""><br class=""></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">    return a &lt; b</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>? b &lt; c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>  ? b&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">          : a &lt; c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>     ? c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>     : a&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>: a &lt; c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>  ? a&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>  : b &lt; c &nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">             ? c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span style="white-space: pre-wrap;" class="">        </span>     : b</font></span></div><div class=""><br class=""></div><div class=""><font color="#222426" size="2" class=""><span style="white-space: pre-wrap;" class="">Is this new syntax helping?<br class=""></span></font><br class=""></div><div class=""><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">    return if a &lt; b </font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>then if b &lt; c &nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>  then b&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">          else if a &lt; c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>     then c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>     else a&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>else if a &lt; c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>  then a&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>  else if b &lt; c &nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">             then c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>     else b</font></span></div></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><br class=""></font></span></div><div class=""><font color="#222426" size="2" class=""><span style="white-space: pre-wrap;" class="">I found this translation quite tricky to do. maybe parens help?</span></font></div><div class=""><font color="#222426" face="Monaco" size="2" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">    return (if a &lt; b </font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>then (if b &lt; c &nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>  then b&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">          else (if a &lt; c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>     then c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>     else a)</font></span><span style="font-family: Monaco; color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class="">)</span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>else (if a &lt; c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>  then a&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>  else (if b &lt; c &nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class="">             then c&nbsp;</font></span></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><span class="">        </span>     else b))</font></span><span style="font-family: Monaco; color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class="">)</span></div></div><div class=""><span style="color: rgb(34, 36, 38); font-size: small; white-space: pre-wrap;" class=""><font face="Monaco" class=""><br class=""></font></span></div><div class=""><font color="#222426" size="2" class=""><span style="white-space: pre-wrap;" class="">Not really and I still I found this hugely frustrating, so much so that I am going to drop all support for this proposal and remove my name from it. If anyone wants to take over feel free.&nbsp;</span></font></div><div class=""><span style="white-space: pre-wrap; color: rgb(34, 36, 38); font-size: small;" class=""><br class=""></span></div><div class=""><span style="white-space: pre-wrap; color: rgb(34, 36, 38); font-size: small;" class="">Others still keen on the idea should try this experiment. It convinced me is horrible idea :-) I don’t want to be blamed for it by every Swift programmer in the future. </span></div><div class=""><font color="#222426" size="2" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><font color="#222426" size="2" class=""><span style="white-space: pre-wrap;" class="">I do still however like the Swift Expressions.</span></font></div><div class=""><font color="#222426" face="Monaco" size="2" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><font color="#222426" face="Monaco" size="2" class=""><span style="white-space: pre-wrap;" class="">- Paul</span></font></div><div class=""><font color="#222426" face="Monaco" size="2" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><div class=""><font color="#222426" face="Monaco" size="2" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></font></div><font color="#222426" face="Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif" size="2" class=""></font><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><br class=""></div><div class="">On Dec 14, 2015, at 4:50 PM, Nick Shelley via swift-evolution &lt;<a class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""><div class=""><div dir="ltr" class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span style="font-size: 12.8px;" class="">I however frequently&nbsp;hear people saying ternary should be avoided because they are hard to read or they hate them.</span></blockquote><div class=""><br class=""></div><div class="">FWIW, I used to be one of those people, but then started working on a team where one member liked them. He didn't force them on us, but after enough code reviews where he showed us how to turn 5-line if/else statements into simple one-line ternary expressions, I got used to reading them and now love them and use them often.</div><div class=""><br class=""></div><div class="">People also hate map, flatMap, reduce, etc., for the same reasons (it's hard for them to read because it's not the for loop they're used to). I think it's a simple matter of getting used to it.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Dec 14, 2015 at 11:57 AM, Chris Lattner via swift-evolution<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a class="">swift-evolution@swift.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><blockquote class="gmail_quote" style="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;" class=""><span class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 14, 2015, at 12:19 AM, Paul Ossenbruggen via swift-evolution &lt;<a class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap: break-word;" class="">Once again, thank you for all the feedback, if I sound in anyway grumpy in responding to any email, it has a bit more to do with my cold than the suggestions.<div class=""><br class=""></div><div class="">I have split the original proposal into two proposals and incorporated a bunch of feedback. Splitting it up has been extremely good, not only does it improve readability, I am actually finding I could take or leave the ternary replacement idea. But the proposal will be there if enough everyone thinks it is a good idea. We could put it to a vote to see if there is enough interest and I would be happy to take it further if there is. I suspect this thread would not exist at all if there was no interest in it. However, I am finding I am far more interested in getting switch expressions.&nbsp;<div class=""><div class=""><br class=""></div><div class="">Ternary Replacement</div><div class=""><a href="https://github.com/possen/swift-evolution/blob/master/0021.md" target="_blank" class="">https://github.com/possen/swift-evolution/blob/master/0021.md</a></div></div></div></div></div></blockquote><br class=""></div></span><div class="">Quick comment.&nbsp; The proposal states:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Is it really better? Why not just keep ternary expressions?<br class="">This is a valid question, there is an advantage in compactness to ternary expressions. I however frequently&nbsp;hear people saying ternary should be avoided because they are hard to read or they hate them. There seems&nbsp;to many who either stronly dislike it or don't care.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">However, it doesn’t actually show that it is solving the objections people have to the ternary operator.&nbsp; It is true that some people find the ?: syntax weird, but an equal number of people say that the problem is that you’re putting complex conditional logic inline into the middle of an expression - this proposal actually makes that objection worse.&nbsp; There are also other objections to ?:, and until you enumerate them, it is hard to see whether this proposal is making things better or worse.</div><div class=""><br class=""></div><div class="">-Chris</div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=Kyo40-2Fb6mK7qqe0u18o4nlmNW45gwtJGUNOsveb6UxMCKU0IxM3AL-2BXB69-2BTeBzqeiHEjxCbGiiTkOy7TeYvpqYPlzaY54wmpuRZO1P8gRoZmxxWLqoqzHkADbbxA8c5rtsQQk4-2Fu7fXEu4WagpNp-2BomNvCIawTMV5yfsYmUNV-2FP44VHctms-2FBjaa-2FVsTHCWfhMLUdui5GKu7Q7-2BIYa8rNI2wUC9BB77lcZvEScfTLI-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""></div><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a 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=""><br class=""></blockquote></div><br class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=emrIhnP1hIf76Foxxv4NNJQX-2FWhcznESwKBSwD1MEwxd0PytJAmY2hR14bdjNHx9PC60KNdBJshimtPsRB3ib-2FN1Tg-2FC9bwRbKYjGsXy4tXXJstbA-2FoRw8e2aYVMq4yzoH-2FeJcfr-2BKiJLFc-2FTstD6N4YvDirL8AEKeS3DuridwsigHaRLD-2BQ56YhyMuQdgianGfqc-2BvZdwzB4GqnwLVr-2Fw-3D-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=OWK4tSasaK2n-2FQIIcS9Ug-2FuFXG-2BJ3z6cFMLgm306hDexgmscs6xC-2FBg0NtqgxvKcEUWmNi3olYxonqodb-2FTuI9u-2F3zcQSSvqxtTKqwPkK6v4OpsrgRvcRudWIVh8dijj7JpwBWpikI96hlFZgyg3-2B0WrU-2FKIkXuOnBaekY0Ivo9BWsZL5wPURtVC-2BoCffsXXi1omqhBPPsEH0XRWKmc-2FpFktUyu3SQFSwnQrQSIDn9Q-3D" alt="" width="1" height="1" border="0" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""></div></blockquote></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=ZEz4qHYnXhPr3bBPu-2FxP4tN3HfWKL-2FtJpqkQ0gkOVSDHGwjYDAnic4hFXhPRjHGLU9AcDJ3Hid2Ykdd-2BsGVSYGMUmp5j946qXaVorKZ6xmrWSgvyyTqi8jHI7FVnDiW1OYmMO5-2BIhBpM-2FV7zD2w23II0zqPfGxEE9W57-2FaVHk-2F5BsEmqvL-2Bh1i-2BCQtyYNk7Rm1YXOxDRj88P-2BR-2F5TQgsfpXCt5IfFv-2FC1rsWxgoWEag-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></body></html>