<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="">To point 1: I agree it needs a new name, I came up with the “demux expression” but maybe there is a better name. </div><div class=""><br class=""></div><div class="">To point 2: Taking a more complex example which uses _ adapted from the swift book. The original </div><div class=""><br class=""></div><div class=""><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">switch</span> somePoint {</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> (<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>):</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">print</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span>"(0, 0) is at the origin"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> (<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>):</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> print(</span>"(<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">somePoint.</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>), 0) is on the x-axis"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> (<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span>):</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> print(</span>"(0, <span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">somePoint.</span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span>)) is on the y-axis"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> (-<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>...<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>, -<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>...<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">2</span>):</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> print(<span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"(</span>\<span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">(</span>somePoint.<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">), </span>\<span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">(</span>somePoint.<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">)) is inside the box"</span>)</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class="">default<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">:</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> print(<span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"(</span>\<span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">(</span>somePoint.<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">), </span>\<span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">(</span>somePoint.<span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">)) is outside of the box"</span>)</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class="">}</div></div><div class=""><br class=""></div><div class="">with the proposed format so the underscore does kind of act like a default in the existing switch statement: </div></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(187, 44, 162);" class="">let </span>string = somePoint ?</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>): <span class="Apple-tab-span" style="white-space:pre">                </span>"(0, 0) is at the origin"</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(187, 44, 162);" class="">_</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>):<span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), 0) is on the x-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(187, 44, 162);" class="">_</span>):<span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: rgb(209, 47, 27);" class="">"(0,</span><span style="color: rgb(209, 47, 27);" class=""> </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is on the y-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (-<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>, -<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>): <span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is inside the box"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (_, _):<span class="Apple-tab-span" style="white-space:pre">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is outside of the box"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><br class=""></div></div><div class="">So, it kind of used like a default. Note, I am suggesting that this also work, if it seems too loose, this would help add structure in more complex cases. </div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(187, 44, 162);" class="">let </span>string = somePoint ?</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> <span style="color: rgb(187, 44, 162);" class="">case</span> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>): <span class="Apple-tab-span" style="white-space: pre;">                </span>"(0, 0) is at the origin"</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> <span style="color: rgb(187, 44, 162);" class="">case </span>(<span style="color: rgb(187, 44, 162);" class="">_</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), 0) is on the x-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> <span style="color: rgb(187, 44, 162);" class="">case </span>(<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(187, 44, 162);" class="">_</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(0,</span><span style="color: rgb(209, 47, 27);" class=""> </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is on the y-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> <span style="color: rgb(187, 44, 162);" class="">case </span>(-<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>, -<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>): <span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is inside the box"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> <span style="color: rgb(187, 44, 162);" class="">default</span>:<span class="Apple-tab-span" style="white-space: pre;">                        </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is outside of the box"</span></div></div><div class=""><br class=""></div><div class="">So you could still do as you suggest: </div><div class=""><br class=""></div><div class=""><div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(187, 44, 162);" class="">let </span>string = somePoint ?</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>): <span class="Apple-tab-span" style="white-space: pre;">                </span>"(0, 0) is at the origin"</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(187, 44, 162);" class="">_</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), 0) is on the x-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(187, 44, 162);" class="">_</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(0,</span><span style="color: rgb(209, 47, 27);" class=""> </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is on the y-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (-<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>, -<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>): <span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is inside the box"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> <span style="color: rgb(187, 44, 162);" class="">default</span>:<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is outside of the box"</span></div></div><div><br class=""></div></div><div>Mathew says that he thinks that parenthesis should not be required, but I think it seems a little loose without them. It is similar to how control structures have { } around things and I am worried about creating ambiguity. </div><div><br class=""></div><div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(187, 44, 162);" class="">let </span>string = somePoint ?(</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>): <span class="Apple-tab-span" style="white-space: pre;">                </span>"(0, 0) is at the origin"</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(187, 44, 162);" class="">_</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), 0) is on the x-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(187, 44, 162);" class="">_</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(0,</span><span style="color: rgb(209, 47, 27);" class=""> </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is on the y-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (-<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>, -<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>): <span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is inside the box"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (_, _):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is outside of the box"</span></div></div><div>}</div><div><br class=""></div><div>I don’t think the “case” and “default" is as necessary with the parenthesis around it. </div><div><br class=""></div><div>Arg! I still want to put the control value inside though! It just kind of floats out there otherwise. </div><div><br class=""></div><div><div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""><span style="color: rgb(187, 44, 162);" class="">let </span>string = ?(somePoint,</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>): <span class="Apple-tab-span" style="white-space: pre;">                </span>"(0, 0) is at the origin"</div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(187, 44, 162);" class="">_</span>, <span style="color: rgb(39, 42, 216);" class="">0</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), 0) is on the x-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (<span style="color: rgb(39, 42, 216);" class="">0</span>, <span style="color: rgb(187, 44, 162);" class="">_</span>):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(0,</span><span style="color: rgb(209, 47, 27);" class=""> </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is on the y-axis"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (-<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>, -<span style="color: rgb(39, 42, 216);" class="">2</span>...<span style="color: rgb(39, 42, 216);" class="">2</span>): <span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is inside the box"</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo;" class=""> (_, _):<span class="Apple-tab-span" style="white-space: pre;">                </span><span style="color: rgb(209, 47, 27);" class="">"(</span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">0</span><span style="color: rgb(209, 47, 27);" class="">), </span>\<span style="color: rgb(209, 47, 27);" class="">(</span>somePoint.<span style="color: rgb(39, 42, 216);" class="">1</span><span style="color: rgb(209, 47, 27);" class="">)) is outside of the box"</span></div></div><div>}</div><div><br class=""></div><div>To point 3: That the ternary presents confusion by using the colon. I think that confusion drops away with the _ as the default. The rule would be that switch expressions would always be exhaustively specified or must use default. For the boolean and index forms the colon does not create confusion, they are used to return the case that does not match one of the choices. </div><div><br class=""></div><div><div class=""><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-family: Menlo; color: rgb(187, 44, 162);">let</span><font face="Menlo" class=""> fb = pickOne ? </font><font color="#d12f1b" face="Menlo" class="">“A",</font><font face="Menlo" class=""> </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"B"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"C"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"D"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"E"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"F"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"G</span><font face="Menlo" class=""><font color="#d12f1b" class="">”</font> : </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"Z"</span></div></div><div class=""><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-family: Menlo; color: rgb(187, 44, 162);">let</span><font color="#008400" class="" style="font-family: Menlo;"> fe = truthy == truth ? </font><font color="#272ad8" class=""><font face="Menlo" class="">“unlikely</font></font><font class=""><font color="#272ad8" face="Menlo" class="">” :</font><font face="Menlo" color="#008400" class=""> </font></font><font color="#272ad8" face="Menlo" class="">“likely”</font></div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; line-height: normal;">or:</div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; line-height: normal;"><font color="#272ad8" face="Menlo" class=""><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica;"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-family: Menlo; color: rgb(187, 44, 162);">let</span><font face="Menlo" class=""> fb = pickOne ? </font><font color="#d12f1b" face="Menlo" class="">“A",</font><font face="Menlo" class=""> </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"B"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"C"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"D"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"E"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"F"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"G</span><font face="Menlo" class=""><font color="#d12f1b" class="">”</font> <span style="color: rgb(187, 44, 162);" class="">default:</span></font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"Z"</span></div></div><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-family: Menlo; color: rgb(187, 44, 162);">let</span><font color="#008400" class="" style="font-family: Menlo;"> fe = truthy == truth ? </font><font color="#272ad8" class=""><font face="Menlo" class="">“unlikely</font></font><font class=""><font color="#272ad8" face="Menlo" class="">” </font></font><span style="color: rgb(187, 44, 162); font-family: Menlo;" class="">default:</span><font class=""><font face="Menlo" color="#008400" class=""> </font></font><font color="#272ad8" face="Menlo" class="">“likely”</font></div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;">or maybe:</div><div class="" style="margin: 0px; line-height: normal;"><br class=""></div><div class="" style="margin: 0px; line-height: normal;"><font color="#272ad8" face="Menlo" class=""><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica;"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-family: Menlo; color: rgb(187, 44, 162);">let</span><font face="Menlo" class=""> fb = pickOne ? </font><font color="#d12f1b" face="Menlo" class="">“A",</font><font face="Menlo" class=""> </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"B"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"C"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"D"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"E"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"F"</span><font face="Menlo" class="">, </font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"G</span><font face="Menlo" class=""><font color="#d12f1b" class="">”</font> <span style="color: rgb(187, 44, 162);" class="">else:</span></font><span class="" style="font-family: Menlo; color: rgb(209, 47, 27);">"Z"</span></div></div><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica;"><div class="" style="margin: 0px; line-height: normal;"><div class="" style="margin: 0px; line-height: normal;"><span class="" style="font-family: Menlo; color: rgb(187, 44, 162);">let</span><font color="#008400" class="" style="font-family: Menlo;"> fe = truthy == truth ? </font><font color="#272ad8" class=""><font face="Menlo" class="">“unlikely</font></font><font class=""><font color="#272ad8" face="Menlo" class="">” </font></font><span style="color: rgb(187, 44, 162); font-family: Menlo;" class="">else:</span><font class=""><font face="Menlo" color="#008400" class=""> </font></font><font color="#272ad8" face="Menlo" class="">“likely”</font></div><div class=""><br class=""></div></div></div></font></div></div></div></div></font></div></div></div></div>Not necessarily recommending that last one but trying it out. Since boolean “ifs" use “else" rather than default. </div><div><br class=""><blockquote type="cite" class=""><div class=""><br class=""></div><div class="">On Jan 6, 2016, at 9:03 AM, Jo Albright <<a href="mailto:me@jo2.co" class="">me@jo2.co</a>> 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="">Just a couple of thoughts swirling in my brain. </div><div class=""><br class=""></div><div class="">1. Ternary means : composed of three parts …. if we add case functionality, it no longer is a ternary and should be renamed (ex : nil coalescing … was used instead of calling it a ternary optional). Would love to hear thoughts on what names it could have … if the proposal moves forward.</div><div class=""><br class=""></div><div class="">---</div><div class=""><br class=""></div><div class="">I am leaning towards this pattern (someone else introduced), yet I don’t feel it is perfect.</div><div class=""><br class=""></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> ? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">_</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><div class=""><br class=""></div><div class="">2. I have a problem with “_”. I don’t agree with it being the default value. It is currently used to discard or ignore values … using it as a default will add unnecessary confusion that does not align with Swift. Writing out the word default instead of _ is only 6 more characters. Please correct me if I am wrong on this note.</div><div class=""><br class=""></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> ? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><div class=""><br class=""></div><div class="">3. Having “?” for the Bool operator and “:” for the cases presents confusion with the current ? : ternary design pattern. This is another potential issue … just not a big of a deal as the “default as _”.</div><div class=""><br class=""></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> case </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> ??? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"><div style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px;" class="">And some less serious ones.</div></span></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"><br class=""></span></div><div class=""><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">switch let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> case </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span></div><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">case let </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(227, 36, 0);">val</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> = </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(102, 156, 53);">color </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">??? </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Red</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFF0000,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Green</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x00FF00,</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(153, 41, 189);">.Blue</span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0x0000FF, </span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;"> <font color="#9929bd" class="">default</font></span><span class="" style="font-family: Arial; font-size: 13px; float: none; display: inline !important;">: </span><span class="" style="font-family: Arial; font-size: 13px; color: rgb(0, 97, 255);">0xFFFFFF</span><div class=""><font color="#0061ff" face="Arial" size="2" class=""><br class=""></font><div class=""><div class="">I do believe this functionality is worth adding to Swift core lib. I just want to see it as closely aligned with Swift as possible.</div><div apple-content-edited="true" class="">
<br class="Apple-interchange-newline"><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=""><font color="#8d8d8d" class=""><span class="Apple-converted-space"> </span>Nerd . Designer . Developer</font></span><font color="#464646" class=""><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="">Jo Albright</span></font><br class=""></div></div></div></div></div></blockquote></div><br class=""></body></html>