[swift-evolution] [Proposal] Foundation Swift Encoders
matthew at anandabits.com
Thu Mar 16 16:48:50 CDT 2017
Thank you again for bringing these great proposals forward!
I only have a couple of questions about this proposal.
I noticed that the types in this proposal don’t conform to Encoder and Decoder. Is the plan to have them to provide private conforming types to Codable types they are asked to encode or decode?
Why are the strategy and format properties readwrite instead of configured at initialization time? Is the intent that the encoder / decoder can be re-used with a different configuration in a subsequent call to encode or decode?
Finally, I agree with Brent’s comments regarding errors. I would prefer to see Foundation move away from NSError in favor of domain-specific error types. That said, the comment that this is a broader discussion for Foundation and not something to change in this proposal is reasonable. I hope Foundation will consider changing this in the future.
More information about the swift-evolution