<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body><div><div style="font-family: Calibri,sans-serif; font-size: 11pt;">Yes, you can do all this but you still have to do everything yourself by hand. Dictionary, plist, it even init as my initial example but you are the one responsible to control when e.g. you add a new value or rename another.<br><br>My proposal causes no big changes and no big overload on the compiler; it just adds an init method to find the equivalent enum value for a string. And yes this feature becomes a lot more interesting should the idea of using tuple typed enums goes forward but they are completely independent.<br><br>L</div></div><div dir="ltr"><hr><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">From: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:pgwsmith@gmail.com">Patrick Smith</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Sent: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">01/06/2016 04:52 AM</span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">To: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:brent@architechies.com">Brent Royal-Gordon</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Cc: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:me@lmpessoa.com">Leonardo Pessoa</a>; <a href="mailto:swift-evolution@swift.org">Swift-evolution</a></span><br><span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Subject: </span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">Re: [swift-evolution] Working with enums by name</span><br><br></div>I had no idea you could do this!!<br><br>> On 1 Jun 2016, at 12:32 PM, Brent Royal-Gordon via swift-evolution <swift-evolution@swift.org> wrote:<br>> <br>> Who said anything about repeating the name?<br>> <br>> Welcome to Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.30). Type :help for assistance.<br>> 1> enum Planet: String { case mercury, venus, earth, mars, jupiter, saturn, uranus, neptune }<br>> 2> Planet.mercury.rawValue<br>> $R0: String = "mercury"<br><br></body></html>