<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes, I think they are a lot like sum (or union) types. In Ceylon enums actually are modeled as union types (there is no specific enum syntax).<br class=""><div class=""><div class=""><br class=""></div><div class="">-Thorsten</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 23.01.2016 um 19:57 schrieb Trent Nadeau via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">While enum cases may not be types from a compiler perspective, I think they are from a user's level.<div class=""><br class=""></div><div class="">Consider:<br class=""><br class=""></div><div class=""><div class="">enum MyError: ErrorType {</div><div class=""> case FileError(fileName: String)</div><div class=""> case SocketError(ipAddr: String, port: Int16)</div><div class="">}</div></div><div class=""><br class=""></div><div class="">From a compiler perspective, it's a tagged union (one type), but for a user this is a set of disjoint types that happen to share the same space and have exhaustiveness checking, etc. It's a much more efficient and convenient version of multiple structs or tuples.</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Jan 23, 2016 at 1:49 PM, Joe Groff <span dir="ltr" class=""><<a href="mailto:jgroff@apple.com" target="_blank" class="">jgroff@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br class="">
> On Jan 23, 2016, at 10:24 AM, Trent Nadeau <<a href="mailto:tanadeau@gmail.com" class="">tanadeau@gmail.com</a>> wrote:<br class="">
><br class="">
> I think it makes sense for enum cases to be UpperCamelCase as they can be thought of as scoped types (singleton types in the case of cases with no associated types).<br class="">
<br class="">
</span>They aren't, though. I don't see much value in setting false expectations.<br class="">
<span class="HOEnZb"><font color="#888888" class=""><br class="">
-Joe<br class="">
<br class="">
</font></span></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature">Trent Nadeau</div>
</div>
_______________________________________________<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=""></div></div></body></html>