> On 26 May 2016, at 5:40 PM, David Hart <[email protected]> wrote:
> 
> I’ve always found those two confusing. But I guess that 
> CustomDebugStringConvertible could provide more information, like the actual 
> type and pointer value. For example, imagine that we make UIColor 
> ValuePreservingStringConvertible, one implementation could look like:
> 
> let a = UIColor(red: 0, green: 0, blue: 0)
> a.description // #000000
> a.debugDescription // <UIColor: 0xcodebeef - red: 0.0, green: 0.0, blue: 0.0>

This distinction seems a little arbitrary to me. However, something like 
`preservedString` would make more sense to me:

let a = UIColor(red: 0, green: 0, blue: 0)
a.preservedString // #000000 — or perhaps more accurate: rgba(0.0,0.0,0.0,1.0)
a.debugDescription // <UIColor: 0xcodebeef - red: 0.0, green: 0.0, blue: 0.0>

This why I think it makes sense to really differentiate `description` from 
`debugDescription`, so it’s no long ‘confusing’ as you say.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to