[swift-evolution] Addition of a standardError OutputStream
Saagar Jha
saagarjha28 at gmail.com
Sun Jul 10 13:35:12 CDT 2016
What is the process for smaller issues like these? I’m guessing that this doesn’t need a proposal; where should it go? On bugs.swift.org <http://bugs.swift.org/>?
> On Jul 8, 2016, at 16:33, Erica Sadun <erica at ericasadun.com> wrote:
>
> Right now it's more like "foo".write(to: &stream) but I agree that having to implement
> a custom stream is kind of irritating for stderr and stdout.
>
> import Cocoa
>
> var str = "Hello, playground"
>
> struct StderrStream: OutputStream {
> static var shared = StderrStream()
> func write(_ string: String) { fputs(string, stderr) }
> }
>
> str.write(to: &StderrStream.shared)
>
> -- E
>
>
>> On Jul 8, 2016, at 4:41 PM, Saagar Jha via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>
>> Currently, it’s rather annoying to print to standard error, requiring either something low-level like fputs. I was wondering if a standardError OutputStream could be added to the standard library, so we could write something like print(“foo”, &standardError).
>>
>> --
>> -Saagar Jha
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160710/ce4e32f6/attachment.html>
More information about the swift-evolution
mailing list