<https://github.com/apple/swift-evolution/blob/master/proposals/
0089-rename-string-reflection-init.md>

Instead of LosslessStringConvertible, could the existing Streamable be used?

    extension String {

        public init<T : Streamable>(_ streamable: T) {
            self.init()
            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


_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to