[swift-evolution] [Review #2] SE-0089: Renaming String.init<T>(_: T)

Ben Rimmington me at benrimmington.com
Sat Jun 4 21:46:14 CDT 2016


Instead of LosslessStringConvertible, could the existing Streamable be used?

    extension String {

        public init<T : Streamable>(_ streamable: T) {
            streamable.write(to: &self)

AFAIK, only three types (UnicodeScalar, Character, String) are streamable.
But other types could add conformance; otherwise why does Streamable exist?

Streamable could be renamed to OutputStreamable, so that InputStreamable
can be added later.

-- Ben

More information about the swift-evolution mailing list