[swift-evolution] [Review] SE-0168: Multi-Line String Literals

Brent Royal-Gordon brent at architechies.com
Thu Apr 13 19:55:51 CDT 2017


> On Apr 13, 2017, at 4:48 PM, Xiaodi Wu <xiaodi.wu at 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170413/51f9d7f5/attachment.html>


More information about the swift-evolution mailing list