> On Apr 13, 2017, at 4:48 PM, Xiaodi Wu <xiaodi...@gmail.com> wrote: > > You say "this is the example set by `print`", but I don't think anything else > actually *follows* that example. No other I/O operation in Swift behaves this > way. > > To be more accurate, it's not `print` that specifies this behavior, but > rather the standard output stream's implementation of > `TextOutputStream.write(_:)`. Swift *explicitly* leaves this choice up to the > TextOutputStream-conforming type. That is, the behavior is up to the receiver > and not the argument of a call to `TextOutputStream.write(_:)`.
I feel like I must be misunderstanding what you're trying to say here, because I *think* what you're trying to say is that `TextOutputStream.write(_:)` is what decides whether to add the terminator, which is not only totally wrong (see https://github.com/apple/swift/blob/adc54c8a4d13fbebfeb68244bac401ef2528d6d0/stdlib/public/core/Print.swift#L260) but doesn't even make any sense since there's a terminator parameter on `print` but none on `write(_:)`. -- Brent Royal-Gordon Architechies
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution