Thanks Brent, this one is quite a keeper :). Concise and very friendly way of 
explaining RawRepresentable.

Sent from my iPhone

On 17 May 2016, at 21:05, Brent Royal-Gordon via swift-evolution 
<[email protected]> wrote:

>> On the other hand: What's the point of "raw-value enums"? Are they just a 
>> bridge-technogy, or is it ok to use them to store constants?
> 
> I think of RawRepresentable (the protocol behind rawValue) as a serialization 
> mechanism, basically the Swift standard library's answer to NSCoding. Thus, 
> rawValue is a way to serialize your enum into an Int or String you know how 
> to read and write from disk. More broadly, I often apply RawRepresentable to 
> structs and have them return plist- or JSON-compatible dictionaries. 
> 
> -- 
> Brent Royal-Gordon
> Architechies
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to