[swift-evolution] [Review] SE-0041: Updating Protocol Naming Conventions for Conversions

Jed Lewison jed.lewison at icloud.com
Tue May 10 22:46:54 CDT 2016


I agree that CustomStringConvertible and CustomDebugStringConvertible are confusing, but in general, ‘Convertible’ and ‘Representable’ as currently used actually make sense to me.

Convert means to transform, so it feels natural to me to think of something that is a FooLiteralConvertible as being something that be converted from a FooLiteral.

To represent means to stand in for, so it feels natural to say that if a can represent b and b can represent a, then it’s representable.

The rub comes with CustomStringConvertible and CustomDebugStringConvertible, which while it makes sense linguistically, creates confusion in Swift because it converts in the opposite direction of all the other convertible protocols.

I’m not sure what the rationale was for moving away from Printable and DebugPrintable; maybe it was that everything should be printable? If so, then perhaps CustomPrintable and CustomDebugPrintable would do the job?

> On May 10, 2016, at 11:48 AM, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hello Swift community,
> 
> The review of "SE-0041: Updating Protocol Naming Conventions for Conversions" begins now and runs through May 16. The proposal is available here:
> 
> 	https://github.com/apple/swift-evolution/blob/master/proposals/0041-conversion-protocol-conventions.md
> 
> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at
> 
> 	https://lists.swift.org/mailman/listinfo/swift-evolution
> 
> or, if you would like to keep your feedback private, directly to the review manager.
> 
> What goes into a review?
> 
> The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
> 
> 	* What is your evaluation of the proposal?
> 	* Is the problem being addressed significant enough to warrant a change to Swift?
> 	* Does this proposal fit well with the feel and direction of Swift?
> 	* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> 
> More information about the Swift evolution process is available at
> 
> 	https://github.com/apple/swift-evolution/blob/master/process.md
> 
> Thank you,
> 
> -Chris Lattner
> Review Manager
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list