<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="">Got ya, so for a more complex example:</div><div class=""><br class=""></div>let myColor = (match yourColor&nbsp;<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case .Blue : &nbsp;.Reds<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case .Green: .Blue&nbsp;<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case&nbsp;.Red: match &nbsp;shade .LightRed : LightGreen, .MediumRed : &nbsp;.DarkGreen : &nbsp;DarkRed&nbsp;<br class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>default: .Yellow<br class="">)<br class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><br class=""></div><div class="">for booleans I would not want to list the true false cases out though.</div><div class=""><br class=""></div><div class=""><span style="color: rgb(34, 34, 34); font-size: 13px;" class="">let myColor = match boolCondition</span><span style="color: rgb(34, 34, 34); font-size: 13px;" class="">&nbsp; .Blue</span>,<span style="color: rgb(34, 34, 34); font-size: 13px;" class="">&nbsp;.Red&nbsp;</span></div><div class=""><font color="#222222" size="2" class=""><br class=""></font></div><div class=""><font color="#222222" size="2" class=""><br class=""></font><div class=""><div dir="ltr" class=""><div class=""><span class="im" style="font-size: 13px;"><div class=""><div class="" style="color: rgb(34, 34, 34);"><br class=""></div></div></span></div></div></div></div><div class=""></div></div></div></div><div><blockquote type="cite" class=""><div class="">On Dec 6, 2015, at 1:32 PM, Alex Lew &lt;<a href="mailto:alexl.mail+swift@gmail.com" class="">alexl.mail+swift@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">To clarify, I would want parens around the entire expression (only when necessary). So<div class=""><br class=""></div><div class=""><div style="font-size:13px" class="">let myColor = match yourColor</div><span class="im" style="font-size:13px"><div class=""><span style="white-space:pre-wrap" class=""> </span>case .Blue : &nbsp;.Red</div><div class=""><span style="white-space:pre-wrap" class=""> </span>case .Green: .Blue&nbsp;</div><div class=""><span style="white-space:pre-wrap" class=""> </span>case&nbsp;.Red: .Green</div><div class=""><span style="white-space:pre-wrap" class=""> </span>default: .Yellow</div><div class=""><br class=""></div><div class=""><span style="color:rgb(34,34,34)" class="">or</span><br class=""></div><div class=""><span style="color:rgb(34,34,34)" class=""><br class=""></span></div><div class=""><div style="color:rgb(34,34,34)" class="">let myColor = match boolCondition</div><div style="color:rgb(34,34,34)" class="">&nbsp; case true: .Blue</div><div style="color:rgb(34,34,34)" class="">&nbsp; case false: .Red</div><div style="color:rgb(34,34,34)" class=""><br class=""></div><div style="color:rgb(34,34,34)" class="">or</div><div style="color:rgb(34,34,34)" class=""><br class=""></div><div style="color:rgb(34,34,34)" class=""><div class="">let myColor = match boolCondition</div><div class="">&nbsp; case true: (match yourColor</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case .Red: .Blue</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; default: .Yellow)</div><div class="">&nbsp; case false: .Red</div><div class=""><br class=""></div><div class="">But I actually think that the parens are unnecessary, as long as we require matches to be exhaustive and for there to be no unreachable cases.</div></div><div class="" style="color:rgb(34,34,34)"></div></div></span></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Dec 6, 2015 at 4:17 PM, Paul Ossenbruggen <span dir="ltr" class="">&lt;<a href="mailto:possen@gmail.com" target="_blank" class="">possen@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
 I agree that ? may imply optional, this may be similar to what you suggested, just filling in the example: Not sure parenthesis are better than braces though:
</div>
<div class="">
 <br class="">
</div>
<div class="">
 <div class="">
  <div class="">
   et myColor = match yourColor ( .Blue : &nbsp;.Red, .Green: .Blue, .Red: .Green, default: .Yellow )
  </div>
  <div class="">
   <br class="">
  </div>
  <div class="">
   <div style="word-wrap:break-word" class="">
    <div class="">
     <div class="">
      <div class="">
       <div class="">
        <div class="">
         <div class="">
          <div class="">
           <div class="">
            <div dir="ltr" class=""></div>
           </div>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
  <div class=""></div>
 </div>
 <div class="">
  <div class="">
   let myColor = match yourColor ( case .Blue : .Red; case .Green: .Blue; &nbsp;case .Red: .Green; default: .Yellow )
  </div>
  <div class="">
   <br class="">
  </div>
  <div class="">
   <div style="word-wrap:break-word" class="">
    <div class="">
     <div class="">
      <div class="">
       <div class="">
        <div class="">
         <div class="">
          <div class="">
           <div class="">
            <div dir="ltr" class=""></div>
           </div>
          </div>
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
  <div class=""></div>
 </div>
 <div class="">
  <div class="">
   let myColor = match yourColor (
  </div><span class="">
  <div class="">
   <span style="white-space:pre-wrap" class=""> </span>case .Blue : &nbsp;.Reds
  </div>
  <div class="">
   <span style="white-space:pre-wrap" class=""> </span>case .Green: .Blue&nbsp;
  </div>
  <div class="">
   <span style="white-space:pre-wrap" class=""> </span>case&nbsp;.Red: .Green
  </div>
  <div class="">
   <span style="white-space:pre-wrap" class=""> </span>default: .Yellow
  </div>
  </span><div class="">
   )
  </div>
  <div class="">
   <br class="">
  </div>
  <div class="">
   <div class="">
    <div class="">
     let myColor = match yourColor (
    </div><span class="">
    <div class="">
     <span style="white-space:pre-wrap" class=""> </span>.Blue : &nbsp;.Reds
    </div>
    <div class="">
     <span style="white-space:pre-wrap" class=""> </span>.Green: .Blue&nbsp;
    </div>
    <div class="">
     <span style="white-space:pre-wrap" class=""> </span>.Red: .Green
    </div>
    <div class="">
     <span style="white-space:pre-wrap" class=""> </span>default: .Yellow
    </div>
    </span><div class="">
     )
    </div>
    <div class="">
     <br class="">
    </div>
   </div>
  </div>
  <div class="">
   let myColor = match boollCondition ( .Blue, .Red )&nbsp;
  </div>
  <div class="">
   <br class="">
  </div>
  <div class="">
   <br class="">
  </div>
 </div>
</div><div class="HOEnZb"><div class="h5">
<div class="">
 <br class="">
 <div class="">
  <blockquote type="cite" class="">
   <div class="">
    On Dec 6, 2015, at 12:54 PM, Alex Lew &lt;
    <a href="mailto:alexl.mail+swift@gmail.com" target="_blank" class="">alexl.mail+swift@gmail.com</a>&gt; wrote:
   </div>
   <br class="">
   <div class="">
    <div dir="ltr" class="">
     Hmm. Something about braces inside expressions just feels wrong to me.
     <div class="">
      <br class="">
     </div>
     <div class="">
      I also read switch? and if? as being some optional-related versions of switch and if. And I don't love putting the condition / value-to-switch-on 
      <i class="">before </i>the keyword, if we're going to use a keyword.
     </div>
     <div class="">
      <br class="">
     </div>
     <div class="">
      (Also: exhaustiveness checking 
      <i class="">could </i>theoretically&nbsp;allow resolution of ambiguity in nested switch expressions. We would just have to require that as soon as you've exhausted all possibilities, you don't add more cases and the expression is over.)
     </div>
    </div>
    <div class="gmail_extra">
     <br class="">
     <div class="gmail_quote">
      On Sun, Dec 6, 2015 at 3:46 PM, Paul Ossenbruggen 
      <span dir="ltr" class="">&lt;<a href="mailto:possen@gmail.com" target="_blank" class="">possen@gmail.com</a>&gt;</span> wrote:
      <br class="">
      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
       <div style="word-wrap:break-word" class="">
        Yep probably does need braces: So for switch? if? suggestion i just made.&nbsp;
        <div class="">
         <br class="">
        </div>
        <div class="">
         <div class="">
          let myColor = yourColor switch? { .Blue : &nbsp;.Red, .Green: .Blue, .Red: .Green, default: .Yellow }
         </div>
         <div class="">
          <br class="">
         </div>
         <div class="">
          <div style="word-wrap:break-word" class="">
           <div class="">
            <div class="">
             <div class="">
              <div class="">
               <div class="">
                <div class="">
                 <div class="">
                  <div class="">
                   <div dir="ltr" class=""></div>
                  </div>
                 </div>
                </div>
               </div>
              </div>
             </div>
            </div>
           </div>
          </div>
         </div>
         <div class=""></div>
        </div>
        <div class="">
         <div class="">
          let myColor = yourColor switch? { case .Blue : .Red; case .Green: .Blue; &nbsp;case .Red: .Green; default: .Yellow }
         </div>
         <div class="">
          <br class="">
         </div>
         <div class="">
          <div style="word-wrap:break-word" class="">
           <div class="">
            <div class="">
             <div class="">
              <div class="">
               <div class="">
                <div class="">
                 <div class="">
                  <div class="">
                   <div dir="ltr" class=""></div>
                  </div>
                 </div>
                </div>
               </div>
              </div>
             </div>
            </div>
           </div>
          </div>
         </div>
         <div class=""></div>
        </div>
        <div class="">
         <span class="">
          <div class="">
           let myColor = yourColor switch? {
          </div>
          <div class="">
           <span style="white-space:pre-wrap" class=""> </span>case .Blue : &nbsp;.Reds
          </div></span>
         <span class="">
          <div class="">
           <span style="white-space:pre-wrap" class=""> </span>case .Green: .Blue&nbsp;
          </div>
          <div class="">
           <span style="white-space:pre-wrap" class=""> </span>case&nbsp;.Red: .Green
          </div>
          <div class="">
           <span style="white-space:pre-wrap" class=""> </span>default: .Yellow
          </div>
          <div class="">
           }
          </div>
          <div class="">
           <br class="">
          </div></span>
         <span class="">
          <div class="">
           <div class="">
            <div class="">
             let myColor = yourColor switch? {
            </div>
            <div class="">
             <span style="white-space:pre-wrap" class=""> </span>.Blue : &nbsp;.Reds
            </div>
            <div class="">
             <span style="white-space:pre-wrap" class=""> </span>.Green: .Blue&nbsp;
            </div>
            <div class="">
             <span style="white-space:pre-wrap" class=""> </span>.Red: .Green
            </div>
            <div class="">
             <span style="white-space:pre-wrap" class=""> </span>default: .Yellow
            </div>
            <div class="">
             }
            </div>
           </div>
          </div>
          <div class="">
           <br class="">
          </div></span>
         <span class="">
          <div class="">
           let myColor = condition if? &nbsp;{ .Blue; .Red }
          </div>
          <div class="">
           <br class="">
          </div></span>
         <div class="">
          I don’t find that looks bad.&nbsp;
         </div>
         <div class="">
          <br class="">
         </div>
         <div class="">
          - Paul&nbsp;
         </div>
         <div class="">
          <br class="">
         </div>
         <div class="">
          <br class="">
          <div class="">
           <blockquote type="cite" class="">
            <div class="">
             <div class="">
              <div class="">
               On Dec 6, 2015, at 12:24 PM, Alex Lew via swift-evolution &lt;
               <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:
              </div>
              <br class="">
             </div>
            </div>
            <div class="">
             <div class="">
              <div class="">
               <div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">
                Thanks for the feedback, Matthew. It's sensible to me to consider dropping the ternary operator. I like it because the analogy "C's if is to Swift's if as C's ternary operator is to Swift's ternary operator" is (sort of) satisfied. But it is also confusing, both for the reasons you mention, and because ? has other meanings in Swift:
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 &nbsp;// compiler error without space betw thatColor and ?
                 <br class="">
                </div>
                <div class="">
                 let thisColor = thatColor?&nbsp;
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;case .Red: .Green
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;default: .Blue
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 On the other hand, is it really worth it to have control flow expressions if they don't let your code look nicer?
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 let thisColor = switch thatColor {
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;case .Red:
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return .Green;
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;default:
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return .Yellow;
                </div>
                <div class="">
                 }
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 really isn't much nicer than
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 let thisColor: Color
                </div>
                <div class="">
                 switch thatColor {
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;case .Red:
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; thisColor = .Green
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;default:
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; thisColor = .Yellow
                </div>
                <div class="">
                 }
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 Maybe we could do a compromise, something like
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 let thisColor = switch thatColor
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;case .Red: .Green // must be an expression
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;default: .Yellow &nbsp; &nbsp; &nbsp;// must be an expression
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 Or we could introduce a new keyword? Like
                 <span class="">&nbsp;</span>
                 <b class="">match</b>:
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 let thisColor = match thatColor
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; case .Red: .Green &nbsp; &nbsp;// must be an expression
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; default: .Yellow &nbsp; &nbsp; &nbsp; &nbsp; // must be an expression
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 I sort of like the new-keyword approach, because even though this is similar to a switch, it's not a switch: there's no fallthrough, you can't put statements inside, etc.
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 The problem with all these proposals:
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 let thisColor = match thatColor
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;case .Red: match thatOtherColor
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case .Blue: .Green
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case .Pink: .Yellow
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default: .Orange
                </div>
                <div class="">
                 &nbsp; &nbsp; &nbsp;default: .Orange
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 is ambiguous. (Does case .Pink match thatColor or thatOtherColor? We can know because of exhaustiveness checking, but this won't always work.) You could solve this problem either by using parentheses around the whole expression when necessary
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 <div class="">
                  let thisColor = match thatColor
                 </div>
                 <div class="">
                  &nbsp; &nbsp; &nbsp;case .Red: (match thatOtherColor
                 </div>
                 <div class="">
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case .Blue: .Green
                 </div>
                 <div class="">
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case .Pink: .Yellow
                 </div>
                 <div class="">
                  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default: .Orange)
                 </div>
                 <div class="">
                  &nbsp; &nbsp; &nbsp;default: .Orange
                 </div>
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 or by adding curly braces in again
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 <div class="">
                  <div class="">
                   let thisColor = match thatColor {
                  </div>
                  <div class="">
                   &nbsp; &nbsp; &nbsp;case .Red: match thatOtherColor {
                  </div>
                  <div class="">
                   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case .Blue: .Green
                  </div>
                  <div class="">
                   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;case .Pink: .Yellow
                  </div>
                  <div class="">
                   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;default: .Orange
                  </div>
                  <div class="">
                   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
                  </div>
                  <div class="">
                   &nbsp; &nbsp; &nbsp;default: .Orange
                  </div>
                 </div>
                </div>
                <div class="">
                 }
                </div>
                <div class="">
                 <br class="">
                </div>
                <div class="">
                 But that starts to look like switch again. (Of course, the best way to handle this is as a programmer is to just switch on the tuple (thatColor, thatOtherColor), but the language should allow for nested control expressions.)
                </div>
                <div class="">
                 <br class="">
                </div>
               </div>
               <div class="gmail_extra" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
                <br class="">
                <div class="gmail_quote">
                 On Sun, Dec 6, 2015 at 2:48 PM, Matthew Johnson via swift-evolution
                 <span class="">&nbsp;</span>
                 <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span>
                 <span class="">&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">
                  I am not a fan of this approach based on the ternary operator.&nbsp; The ternary operator is already a bit of an anomaly in that all other operators are unary or binary and do not perform any control flow (beyond possibly short circuiting an autoclosure argument).
                  <div class="">
                   <br class="">
                  </div>
                  <div class="">
                   I would much rather features that perform control flow continue to use keywords, but allow them to be expressions. &nbsp;
                  </div>
                  <div class="">
                   <br class="">
                  </div>
                  <div class="">
                   Once we have control flow expressions I would like to see the ternary operator removed from the language as it would no longer server a purpose.&nbsp; Removing the ternary operator seems to fit nicely with the direction to remove some features that are carried over from C-based languages but don’t necessarily fit with the direction Swift is heading.
                  </div>
                  <div class="">
                   <div class="">
                    <div class="">
                     <br class="">
                    </div>
                    <div class="">
                     <div class="">
                      <br class="">
                      <div class="">
                       <blockquote type="cite" class="">
                        <div class="">
                         On Dec 6, 2015, at 1:19 PM, Kevin Lundberg via swift-evolution &lt;
                         <span class="">&nbsp;</span>
                         <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:
                        </div>
                        <br class="">
                        <div class="">
                         <div class="">
                          <div class="">
                           Ostensibly, case may not be necessary if you could delimit each case on one line with something (perhaps a comma, or something else if that would not fit well within the grammar):
                           <span class="">&nbsp;</span>
                           <br class="">
                          </div>
                          <div class="">
                           &nbsp;
                          </div>
                          <div class="">
                           let thisColor = thatColor ? .Blue: .Red, .Green: .Blue, .Red: .Green, default: .Yellow
                           <span class="">&nbsp;</span>
                           <br class="">
                          </div>
                          <div class="">
                           &nbsp;
                          </div>
                          <div class="">
                           On Sun, Dec 6, 2015, at 01:57 PM, Paul Ossenbruggen via swift-evolution wrote:
                           <span class="">&nbsp;</span>
                           <br class="">
                          </div>
                          <blockquote type="cite" class="">
                           <div class="">
                            I like this too, seems more powerful.&nbsp; Also, would single line expressions be allowed?&nbsp; If not would case be required for example:
                            <span class="">&nbsp;</span>
                            <br class="">
                           </div>
                           <div class="">
                            &nbsp;
                           </div>
                           <div class="">
                            <div class="">
                             <div dir="ltr" class="">
                              <div class="">
                               let myFavoriteColor = yourFavoriteColor ?
                               <span class="">&nbsp;</span>
                               <br class="">
                              </div>
                              <div class="">
                               &nbsp; &nbsp;
                               <span class="">&nbsp;</span>case .Blue: .Red
                               <span class="">&nbsp;</span>
                               <br class="">
                              </div>
                              <div class="">
                               &nbsp; &nbsp;
                               <span class="">&nbsp;</span>case .Green: .Blue
                               <span class="">&nbsp;</span>
                               <br class="">
                              </div>
                              <div class="">
                               &nbsp; &nbsp;
                               <span class="">&nbsp;</span>case .Red: .Green
                               <span class="">&nbsp;</span>
                               <br class="">
                              </div>
                              <div class="">
                               &nbsp; &nbsp;
                               <span class="">&nbsp;</span>default: .Yellow
                               <span class="">&nbsp;</span>
                               <br class="">
                              </div>
                             </div>
                            </div>
                            <div class="">
                             <div class="">
                              <div dir="ltr" class="">
                               <div class="">
                                &nbsp;
                               </div>
                              </div>
                             </div>
                            </div>
                            <div class="">
                             <div class="">
                              &nbsp;
                             </div>
                             <div class="">
                              <blockquote type="cite" class="">
                               <div class="">
                                On Dec 6, 2015, at 9:11 AM, Sean Heber via swift-evolution &lt;
                                <span class="">&nbsp;</span>
                                <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:
                                <span class="">&nbsp;</span>
                                <br class="">
                               </div>
                               <div class="">
                                &nbsp;
                               </div>
                               <div class="">
                                <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" class="">
                                 <div class="">
                                  I really like this train of thought. +1
                                  <span class="">&nbsp;</span>
                                  <br class="">
                                 </div>
                                 <div class="">
                                  &nbsp;
                                 </div>
                                 <div class="">
                                  l8r
                                  <span class="">&nbsp;</span>
                                  <br class="">
                                 </div>
                                </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" class="">
                                 <div class="">
                                  Sean
                                  <span class="">&nbsp;</span>
                                  <br class="">
                                 </div>
                                </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" class="">
                                 <div class="">
                                  &nbsp;
                                 </div>
                                 <div class="">
                                  On Dec 6, 2015, at 11:02 AM, Alex Lew via swift-evolution &lt;
                                  <span class="">&nbsp;</span>
                                  <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:
                                  <span class="">&nbsp;</span>
                                  <br class="">
                                 </div>
                                </div>
                                <blockquote type="cite" 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" class="">
                                 <div class="">
                                  <div dir="ltr" class="">
                                   <div class="">
                                    What if we left the if { ...} else { ... } syntax alone (as a statement), and updated the ternary expression to be a more general pattern matching expression (closer to "switch")? Something like
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp;
                                   </div>
                                   <div class="">
                                    let x = condition ?
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;true: "Hello"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;false: "Goodbye"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp;
                                   </div>
                                   <div class="">
                                    let x = optionalValue ?
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;.Some(let unwrapped): "Hello, \(unwrapped)"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;.None: "To Whom It May Concern"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp;
                                   </div>
                                   <div class="">
                                    let myFavoriteColor = yourFavoriteColor ?
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;
                                    <span class="">&nbsp;</span>.Blue: .Red
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;
                                    <span class="">&nbsp;</span>.Green: .Blue
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;
                                    <span class="">&nbsp;</span>.Red: .Green
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp;
                                   </div>
                                   <div class="">
                                    let quadrant = (x, y) ?
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;
                                    <span class="">&nbsp;</span>let (x, y) where x &lt; 50 &amp;&amp; y &lt; 50: "top left"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;
                                    <span class="">&nbsp;</span>let (x, y) where x &lt; 50 &amp;&amp; y &gt; 50: "bottom left"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;
                                    <span class="">&nbsp;</span>let (x, y) where x &gt; 50 &amp;&amp; y &lt; 50: "top right"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp; &nbsp;
                                    <span class="">&nbsp;</span>default: "bottom right"
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp;
                                   </div>
                                   <div class="">
                                    The colon comes from the fact that this is sort of a light-weight expression-based "switch" statement, where each branch can only contain an expression, not a series of statements.
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                   <div class="">
                                    &nbsp;
                                   </div>
                                   <div class="">
                                    This is very similar to pattern matching expressions in languages like Haskell, ML, and Coq.
                                    <span class="">&nbsp;</span>
                                    <br class="">
                                   </div>
                                  </div>
                                  <div class="">
                                   <div class="">
                                    &nbsp;
                                   </div>
                                   <div class="">
                                    <div class="">
                                     On Sun, Dec 6, 2015 at 11:25 AM, Thorsten Seitz
                                     <span class="">&nbsp;</span>
                                     <span class=""></span>
                                     <span dir="ltr" class="">&lt;<a href="mailto:thorsten.seitz@web.de" target="_blank" class="">thorsten.seitz@web.de</a>&gt;</span>
                                     <span class="">&nbsp;</span>
                                     <span class=""></span>wrote:
                                     <span class="">&nbsp;</span>
                                     <br class="">
                                    </div>
                                    <blockquote 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" class="">
                                     <div style="word-wrap:break-word" class="">
                                      <div class="">
                                       <div class="">
                                        &nbsp;
                                       </div>
                                       <blockquote type="cite" class="">
                                        <div class="">
                                         <span class="">Am 06.12.2015 um 01:28 schrieb Alex Lew via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;:</span>
                                         <span class="">&nbsp;</span>
                                         <br class="">
                                        </div>
                                        <div class="">
                                         &nbsp;
                                        </div>
                                        <div class="">
                                         <div dir="ltr" class="">
                                          <div class="">
                                           <span class="">I don't think you can just get rid of the if statement in favor of an expression. You still want to be able to do this:</span>
                                           <span class="">&nbsp;</span>
                                           <br class="">
                                          </div>
                                          <div class="">
                                           &nbsp;
                                          </div>
                                          <div class="">
                                           <span class="">if (condition) {</span>
                                           <span class="">&nbsp;</span>
                                           <br class="">
                                          </div>
                                          <div class="">
                                           <span class="">&nbsp; &nbsp;<span class="">&nbsp;</span>funcWithSideEffectsThatReturnsInt()</span>
                                           <span class="">&nbsp;</span>
                                           <br class="">
                                          </div>
                                          <div class="">
                                           <span class="">} else {</span>
                                           <span class="">&nbsp;</span>
                                           <br class="">
                                          </div>
                                          <div class="">
                                           <span class="">&nbsp; &nbsp;<span class="">&nbsp;</span>funcWithSideEffectsThatReturnsString()</span>
                                           <span class="">&nbsp;</span>
                                           <br class="">
                                          </div>
                                          <div class="">
                                           <span class="">}</span>
                                           <span class="">&nbsp;</span>
                                           <br class="">
                                          </div>
                                          <div class="">
                                           &nbsp;
                                          </div>
                                          <div class="">
                                           <span class="">but that's not a valid expression (what is its type?).</span>
                                           <span class="">&nbsp;</span>
                                           <br class="">
                                          </div>
                                         </div>
                                        </div>
                                       </blockquote>
                                       <div class="">
                                        &nbsp;
                                       </div>
                                       <div class="">
                                        &nbsp;
                                       </div>
                                       <div class="">
                                        That would actually be no problem if Swift’s type system would have union types (Ceylon has union and intersection types which are quite awesome and enable lots of nice things quite naturally, see
                                        <span class="">&nbsp;</span>
                                        <span class=""></span>
                                        <a href="http://ceylon-lang.org/documentation/1.2/tour/types/" target="_blank" class="">http://ceylon-lang.org/documentation/1.2/tour/types/</a>).
                                        <span class="">&nbsp;</span>
                                        <br class="">
                                       </div>
                                       <div class="">
                                        &nbsp;
                                       </div>
                                       <div class="">
                                        In that case the type of such an expression would just be the union of both types, which is written
                                        <span class="">&nbsp;</span>
                                        <span class=""></span>
                                        <span style="font-family:Courier" class="">Int | String</span>
                                        <span class="">&nbsp;</span>
                                        <span class=""></span>in Ceylon.
                                        <span class="">&nbsp;</span>
                                        <br class="">
                                       </div>
                                       <div class="">
                                        &nbsp;
                                       </div>
                                       <div class="">
                                        &nbsp;
                                       </div>
                                       <div class="">
                                        <span class=""><span style="color:rgb(136,136,136)" class="">-Thorsten</span></span>
                                        <span class="">&nbsp;</span>
                                        <br class="">
                                       </div>
                                       <div class="">
                                        &nbsp;
                                       </div>
                                      </div>
                                      <div class="">
                                       &nbsp;
                                      </div>
                                     </div>
                                    </blockquote>
                                   </div>
                                   <div class="">
                                    &nbsp;
                                   </div>
                                  </div>
                                  <div class="">
                                   <br class="">
                                  </div>
                                 </div>
                                </blockquote>
                                <blockquote type="cite" 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" class="">
                                 <div class="">
                                  <div class="">
                                   <span class="">_______________________________________________</span>
                                   <span class="">&nbsp;</span>
                                   <br class="">
                                  </div>
                                  <div class="">
                                   <span class="">swift-evolution mailing list</span>
                                   <span class="">&nbsp;</span>
                                   <br class="">
                                  </div>
                                  <div class="">
                                   <span class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a></span>
                                   <span class="">&nbsp;</span>
                                   <br class="">
                                  </div>
                                  <div class="">
                                   <span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span>
                                   <span class="">&nbsp;</span>
                                   <br class="">
                                  </div>
                                 </div>
                                </blockquote>
                                <div class="">
                                 <span style="font-family:Helvetica" class=""><span class=""></span>_______________________________________________</span>
                                 <span class="">&nbsp;</span>
                                 <br class="">
                                </div>
                                <div class="">
                                 <span style="font-family:Helvetica" class="">swift-evolution mailing list</span>
                                 <span class="">&nbsp;</span>
                                 <br class="">
                                </div>
                                <div class="">
                                 <a href="mailto:swift-evolution@swift.org" 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" target="_blank" class="">swift-evolution@swift.org</a>
                                 <span class="">&nbsp;</span>
                                 <br class="">
                                </div>
                                <div class="">
                                 <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" 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" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a>
                                 <span class="">&nbsp;</span>
                                 <br class="">
                                </div>
                               </div>
                              </blockquote>
                             </div>
                            </div>
                           </div>
                           <div class="">
                            <br class="">
                           </div>
                           <div class="">
                            <u class="">_______________________________________________</u>
                            <span class="">&nbsp;</span>
                            <br class="">
                           </div>
                           <div class="">
                            swift-evolution mailing list
                            <span class="">&nbsp;</span>
                            <br class="">
                           </div>
                           <div class="">
                            <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>
                            <span class="">&nbsp;</span>
                            <br class="">
                           </div>
                           <div class="">
                            <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a>
                            <span class="">&nbsp;</span>
                            <br class="">
                           </div>
                          </blockquote>
                          <div class="">
                           &nbsp;
                          </div>
                         </div>_______________________________________________
                         <span class="">&nbsp;</span>
                         <br class="">swift-evolution mailing list
                         <span class="">&nbsp;</span>
                         <br class="">
                         <a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>
                         <span class="">&nbsp;</span>
                         <br class="">
                         <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a>
                         <span class="">&nbsp;</span>
                         <br class="">
                        </div>
                       </blockquote>
                      </div>
                      <br class="">
                     </div>
                    </div>
                    <div style="margin-top:10px;font-size:12px;font-family:Helvetica,Arial;color:rgb(153,153,153)" class="">
                     Untracked with
                     <span class="">&nbsp;</span>
                     <a href="https://trackbuster.com/?sig" style="color:rgb(153,153,153)" target="_blank" class="">Trackbuster</a>
                    </div>
                   </div>
                  </div>
                  <br class="">_______________________________________________
                  <br class="">swift-evolution mailing list
                  <br class="">
                  <a href="mailto:swift-evolution@swift.org" target="_blank" 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>
              </div>
             </div>
             <span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant: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" class=""><span class="">&nbsp;</span>_______________________________________________</span>
             <span class=""><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant: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" 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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" 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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span>
            </div>
           </blockquote>
          </div>
          <br class="">
         </div>
        </div>
       </div>
      </blockquote>
     </div>
     <br class="">
    </div> 
   </div>
  </blockquote>
 </div>
 <br class="">
</div>
<div style="margin-top:10px;font-size:12px;font-family:Helvetica,Arial;color:#999" class="">
 Untracked with 
 <a style="color:#999" href="https://trackbuster.com/?sig" target="_blank" class="">Trackbuster</a>
</div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>