<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="">My wild aspirations in a nutshell:</div><div class=""><br class=""></div><div class="">Core enums: Any enum that's created without raw or associated values, e.g. enum MyEnum {case This, That, Whatever, Etc}, can (and should) be Array<Self> representable. This would add intrinsic ordering and raw value construction starting with 0, up to count - 1. End-devs could use the ordering or not use the ordering, but it would be possible to convert to bit representation (1 << this.rawValue), support iteration through the enumeration, introduce ranges for switches, etc. A massive improvement.</div><div class=""><br class=""></div><div class="">Raw value enums: Any enum that uses raw values, e.g. enum ForExample: String {case Hello = "hello", There = "there"} should be representable as Set<T></div><div class=""><br class=""></div><div class="">Associated type enums: all bets are off</div><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 12:52 PM, Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I brought up this topic a couple weeks ago in a thread called "List of all Enum values (for simple enums)":<div class=""><br class=""></div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001233.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001233.html</a><br class=""></div><div class=""><br class=""></div><div class="">I suppose it's time to start synthesizing those ideas/discussion into a proposal :)</div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div>
<br class=""><div class="gmail_quote">On Mon, Dec 21, 2015 at 8:35 AM, Stephen Celis 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"><div style="word-wrap:break-word" class=""><span class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 11:27 AM, Nevin Brackett-Rozinsky <<a href="mailto:nevin.brackettrozinsky@gmail.com" target="_blank" class="">nevin.brackettrozinsky@gmail.com</a>> wrote:</div><br 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="">Would .cases return the enum’s cases in source-code order? That seems fragile at first glance.<div class=""><br class=""></div><div class="">It might be worth considering to have it return an unordered collection (set) instead.</div></div></div></blockquote><br class=""></div></span><div class="">Care to elaborate on why you think it may be fragile?</div><div class=""><br class=""></div><div class="">Retaining order makes sense to me given that integer-backed enumerations auto-increment and that enumerations cannot be extended with new cases. I'm not opposed to using a set, though, if that makes more sense.</div><div class=""><br class=""></div><div class="">Stephen</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=P-2BsYbBZHRBuLDBJaL4DIKDNfkkjpROowTyRAObV11qz-2BlWISDIWx5KTzVEuc7Ura65Ls-2BOnZvmq1jNshAhVy784qTc7FW9QunMu3rnUkaTK3KamSfyI-2FJhIbkN27pUH5DozjvITF7cRxzJ3qxx0Epp-2F1-2FBc2NHyI886pdy0w3pjR83bU2ZKUKuE7bqUaj74nVVOlulXgRSWauNmArN7yQY9-2FrfHqY7JuFuUpN9D31do-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
</div>
<br class="">_______________________________________________<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="">
<br class=""></blockquote></div><br class=""></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=r5jpKsi6nat7oa43lpCLi5GRGm2utDkbDscuFklXZ2cpMUJlONEyxRr3-2BNxfNVcU-2BodUSO16W18lQMg5vdRz4fKG9oSTmn9EV46qgkh8rI0vBPkzXGGtg0ncFXghNG4q3NoHv7CrSm27drNXyn-2Bu-2FntHpYpVcKGKaPnfghDHRgtIH363qa-2B-2F1fgOdzqMA7kX08oKOlJ3HlmPeCZXebkpDpxXWIjh4Ll2J4-2BbUJfurQU-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>