[swift-evolution] [swift-evolution-announce] [Returned for revision] SE-0089: Renaming String.init<T>(_: T)

Patrick Smith pgwsmith at gmail.com
Sun May 29 00:46:51 CDT 2016


Thanks for replying Chris!

> On 29 May 2016, at 6:00 AM, Chris Lattner <clattner at apple.com> wrote:
> 
> 2) If a value wants a better, or more customized, string form, then it conforms to CustomStringConvertible.


What are the use cases for this more customized string form? If it is for the programmer, then debugDescription seems to be a better fit? For Playgrounds, the CustomPlaygroundQuickLookable protocol is used.

What are its other use cases? APIs? What about Streamable? Does this not take the same responsibility — it converts the receiver into a string? Here it seems like it trumps CustomStringConvertible with string conversion: https://github.com/apple/swift/blob/cf73dd9177c231a15429b08ae889e94f20e53f50/stdlib/public/core/OutputStream.swift#L332

Patrick




More information about the swift-evolution mailing list