<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="">I would actually prefer the if statement become more functional vs flow-control which would encompass the ternary statement.<div class=""><br class=""></div><div class="">So&nbsp;</div><div class=""><br class=""></div><div class="">let x = if (boolean) “true” else “false”</div><div class=""><br class=""></div><div class="">or&nbsp;</div><div class=""><br class=""></div><div class="">let x =</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if (boolean)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>“true”</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>else&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>“false”</div><div class=""><br class=""></div><div class="">or&nbsp;</div><div class=""><br class=""></div><div class="">let n =&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if (boolean) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>print(“test”)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>“true”</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>else&nbsp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>false</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">If becomes just another function as opposed to pure flow-control.</div><div class=""><br class=""></div><div class="">A similar approach to switch would also be nice. &nbsp;</div><div class=""><br class=""></div><div class="">Before Swift was really just a vehicle for UI applications, but now it is aiming to be more of a general language for server as well (available on Linux). &nbsp;UI’s generally by their nature are object-oriented, and thus extending it’s functional side was not a priority….. but moving forward it would be nice if it incorporated more of Scala’s functional paradigm into the language (where it does not overtly affect performance) so that developers can program functionally or object-oriented - whatever is the best fit. &nbsp;</div><div class=""><br class=""></div><div class="">-Craig</div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 2015-12-15, at 12:01:46, Paul Ossenbruggen 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=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Chris,</div><div class=""><br class=""></div>Yes definitely, after splitting the proposal up, and some of the feedback I got on the first draft, I became less enamored of the idea and I understand the objections, and we need answer the question "is this really better?”. &nbsp;If others have strong reasons why they really don’t like ternary or reasons they may have heard, please let me know and I would be happy to add them to the proposal.&nbsp;<div class=""><br class=""></div><div class="">- Paul&nbsp;<br class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 14, 2015, at 10:57 AM, Chris Lattner &lt;<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" 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 href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" 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" class="">https://github.com/possen/swift-evolution/blob/master/0021.md</a></div></div></div></div></div></blockquote><br class=""></div><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></div></div></blockquote></div><br class=""></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=CGU22LnxbYa2EM3wKvzuC6syQDwKa0tMs5IyT5gL1wLkc6H8xOrb75-2FGrqSWLf5WPk81QrqiYK-2FOoZ5CWJqJ6eXp6Y9v1hHFD9Ak-2FsfS2tu3NvdppdNvsGdJmYAen2ynJf2dJIHbo8bergGKzQBxySJL77ca-2FKmrcWw6nbOI29mtBZ3WubcaiIdco8xYt-2B8sEzTMLbKHpNAnS1VBxIejmjyTMpil6dN-2BimKGucKVgeU-3D" alt="" width="1" height="1" border="0" style="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;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>