<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 1, 2016, at 7:03 PM, Howard Lovatt <<a href="mailto:howard.lovatt@gmail.com" class="">howard.lovatt@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Isn't that just a nested enum:<div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>It’s not nested. You can still put all the cases in one switch and ignore the labels if you want to.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""> <span style="font-size:13px" class="">enum X {</span></div><span style="font-size:13px" class=""> case L1: L1Type</span><div class=""> case L2: L2Type<br style="font-size:13px" class=""><span style="font-size:13px" class=""> enum L1Type {</span></div><div class=""><span style="font-size:13px" class=""> case A, B, </span><span style="font-size:13px" class="">C</span></div><div class=""> }<br style="font-size:13px" class=""><span style="font-size:13px" class=""> enum L2Type {</span><br style="font-size:13px" class=""><span style="font-size:13px" class=""> case D, E, F</span></div><div class=""> }<br style="font-size:13px" class=""><span style="font-size:13px" class="">}</span></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On 2 February 2016 at 10:53, Amir Michail via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">These labels allow you to group items in an enum:<br class="">
<br class="">
enum X {<br class="">
L1:<br class="">
case A, B<br class="">
case C<br class="">
L2:<br class="">
case D, E, F<br class="">
}<br class="">
<br class="">
switch x {<br class="">
case L1: handleL1(x)<br class="">
case L2: handleL2(x)<br class="">
}<br class="">
<br class="">
func handleL1(x:X) {<br class="">
switch x L1 {<br class="">
case .A: ...<br class="">
case .B: ...<br class="">
case .D: ...<br class="">
}<br class="">
}<br class="">
<br class="">
func handleL2(x:X) {<br class="">
switch x L2 {<br class="">
case .D: ...<br class="">
case .E: ...<br class="">
case .F: ...<br class="">
}<br class="">
}<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" 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="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"> -- Howard.<br class=""></div>
</div>
</div></blockquote></div><br class=""></body></html>