<div dir="ltr">That is certainly a pragmatic solution. However, it would seem to me that it defeats the raison d&#39;etre for the proposal. As I understand it, the whole idea here is that enum associated values work like argument lists, but the syntax is subtly different. Therefore, let&#39;s make the rules the same.<div><br></div><div>If we have to introduce new keywords to make that workable, then instead of simplifying and streamlining the language we&#39;ve just added more rules to it. In some ways, that&#39;s taking us to a very different end result. Given recent discussion on this list over concerns that too much syntactic sugar is being proposed that weigh down the language, we should be wary of this.<div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 1:53 PM, Christopher Kornher via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Feb 20, 2017, at 12:31 PM, Christopher Kornher via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_4616790934352499055Apple-interchange-newline"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite"><div><br class="m_4616790934352499055Apple-interchange-newline">On Feb 18, 2017, at 6:16 AM, David Rönnqvist via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_4616790934352499055Apple-interchange-newline"><div><div dir="auto"><div>On 18 Feb 2017, at 09:30, Slava Pestov via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>+1, two small questions:<div><br></div><div>- If two cases have the same base name but different full names, will matching on the base name match both cases, or will it be an error?</div></div></blockquote><div><br></div><div>I feel that it would be safer if it was an error. If the developer intends to match both cases, requiring both explicitly is a (slight) inconvenience but it&#39;s also very clear about what&#39;s going to match. </div></div></div></blockquote><div><br></div><div>I disagree. It is simple enough to use different base names if you don’t want the cases to match. An example of why it should not be an error: I intend to for errors with same base names to be handled in the same way and I don’t want to enumerate all the similar cases and change code every time I add a new way to construct an error. I understand that other people want the equivalent of function overloading. Code that needs to access values must deal with unique cases, so type safety is assured in any case.</div><div><br></div><div>Java enums have arguments and match on “base names” (they are quite different, but the precedent exists) and I don’t think that matching on the base name would be confusing. I also do not believe that it is worth adding this feature if all cases are completely unique.The pain of forcing a (probably small) subset of developers to use unique names is preferable to complicating the language for no functional benefit, in my opinion.</div></div></div></blockquote><div><br></div></span><div>A possible compromise: specify that all base names should be matched with a new keyword (or?) Here the keyword ```all``` is used to match all base names.</div><div><br></div><div>```</div><div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">enum</span><span style="font-variant-ligatures:no-common-ligatures"> MyError : </span><span style="font-variant-ligatures:no-common-ligatures;color:#703daa">Error</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">{</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">case</span><span style="font-variant-ligatures:no-common-ligatures"> e( a: </span><span style="font-variant-ligatures:no-common-ligatures;color:#703daa">String</span><span style="font-variant-ligatures:no-common-ligatures"> )</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">case</span><span style="font-variant-ligatures:no-common-ligatures"> e( a: Int )</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo;min-height:15px"><br><span style="font-variant-ligatures:no-common-ligatures"></span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">func</span><span style="font-variant-ligatures:no-common-ligatures"> handleError( error: </span><span style="font-variant-ligatures:no-common-ligatures;color:#4f8187">MyError</span><span style="font-variant-ligatures:no-common-ligatures"> )</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">{</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">switch</span><span style="font-variant-ligatures:no-common-ligatures"> error {</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">case</span><span style="font-variant-ligatures:no-common-ligatures"> all .e :</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">        </span><span style="font-variant-ligatures:no-common-ligatures;color:#ba2da2">break</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">    }</span></div><div style="margin:0px;font-size:13px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">}</span></div></div><div>```</div><div><div class="h5"><br><blockquote type="cite"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><br></div><br><blockquote type="cite"><div><div dir="auto"><br><blockquote type="cite"><div><div><div>- What are the memory layout optimizations described here? From a first glance this looks purely syntactic.</div><div><br></div><div>Slava</div><div><br><div><blockquote type="cite"><div>On Feb 17, 2017, at 7:26 PM, John McCall via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_4616790934352499055Apple-interchange-newline"><div><div style="word-wrap:break-word">Hello Swift community,<br><br>The review of &quot;SE-0155: Normalize Enum Case Representation&quot; begins now and runs through next Friday, February 26th. The proposal is available here:<div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0155-normalize-enum-case-representation.md" target="_blank">https://github.com/apple/<wbr>swift-evolution/blob/master/<wbr>proposals/0155-normalize-enum-<wbr>case-representation.md</a><div><br></div><div>Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at</div><div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a></div><div>or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:</div><div><br><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>Proposal link: <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0155-normalize-enum-case-representation.md" target="_blank">https://github.com/<wbr>apple/swift-evolution/blob/<wbr>master/proposals/0155-<wbr>normalize-enum-case-<wbr>representation.md</a></div><div><br></div><div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>Reply text</div><div><br><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>Other replies</div><div><br></div><div><b>What goes into a review?</b><br><br>The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:<br><br><div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>• What is your evaluation of the proposal?<br></div><div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>• Is the problem being addressed significant enough to warrant a change to Swift?<br></div><div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>• Does this proposal fit well with the feel and direction of Swift?<br></div><div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br></div><div><span class="m_4616790934352499055Apple-tab-span" style="white-space:pre-wrap">        </span>• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br></div><div><br></div>More information about the Swift evolution process is available at <a href="https://github.com/apple/swift-evolution/blob/master/process.md" target="_blank">https://github.com/apple/<wbr>swift-evolution/blob/master/<wbr>process.md</a><div><br><div>Thank you,<br><br>John McCall<br>Review Manager</div></div></div></div></div>______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></div></blockquote></div><br></div></div></div></blockquote><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a></span><br></div></blockquote></div>______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps: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">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps: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">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a></div></blockquote></div></div></div><br></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div></div></div></div>