Why not just OutputStream.stderr?<br><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 11, 2016 at 14:25 Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Just throwing this here. Unfortunately `Stream` is already taken (and tied to Foundation).<div><br></div><div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo"><div style="margin:0px;line-height:normal"><span style="color:#bb2ca2">public</span><span> </span><span style="color:#bb2ca2">struct</span><span> StdStream {</span></div><div style="margin:0px;line-height:normal"><span> </span><span style="color:#bb2ca2">public</span><span> </span><span style="color:#bb2ca2">struct</span><span> StderrStream: </span><span style="color:#703daa">OutputStream</span><span> {</span></div><div style="margin:0px;line-height:normal"><span> </span><span style="color:#bb2ca2">public</span><span> </span><span style="color:#bb2ca2">func</span><span> write(</span><span style="color:#bb2ca2">_</span><span> string: </span><span style="color:#703daa">String</span><span>) { </span><span style="color:#3d1d81">fputs</span><span>(string, Darwin.</span><span style="color:#703daa">stderr</span><span>) }</span></div><div style="margin:0px;line-height:normal"><span> }</span></div><p style="margin:0px;line-height:normal;min-height:19px"><span> </span><br></p><div style="margin:0px;line-height:normal"><span> </span><span style="color:#bb2ca2">public</span><span> </span><span style="color:#bb2ca2">struct</span><span> StdoutStream: </span><span style="color:#703daa">OutputStream</span><span> {</span></div><div style="margin:0px;line-height:normal"><span> </span><span style="color:#bb2ca2">public</span><span> </span><span style="color:#bb2ca2">func</span><span> write(</span><span style="color:#bb2ca2">_</span><span> string: </span><span style="color:#703daa">String</span><span>) { </span><span style="color:#3d1d81">fputs</span><span>(string, Darwin.</span><span style="color:#703daa">stdout</span><span>) }</span></div><div style="margin:0px;line-height:normal"><span> }</span></div><p style="margin:0px;line-height:normal;min-height:19px"><span> </span><br></p><div style="margin:0px;line-height:normal"><span> </span><span style="color:#bb2ca2">public</span><span> </span><span style="color:#bb2ca2">static</span><span> </span><span style="color:#bb2ca2">var</span><span> err = </span><span style="color:#4f8187">StderrStream</span><span>()</span></div><div style="margin:0px;line-height:normal"><span> </span><span style="color:#bb2ca2">public</span><span> </span><span style="color:#bb2ca2">static</span><span> </span><span style="color:#bb2ca2">var</span><span> out = </span><span style="color:#4f8187">StdoutStream</span><span>()</span></div><div style="margin:0px;line-height:normal"><span>}</span></div></div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo"><br></div><div>So in use, it would look something like </div><div><br></div><div><div style="margin:0px;font-size:16px;line-height:normal;font-family:Menlo"><div style="margin:0px;line-height:normal;color:rgb(79,129,135)"><span>str</span><span style="color:#000000">.</span><span style="color:#3d1d81">write</span><span style="color:#000000">(to: &</span><span>StdStream</span><span style="color:#000000">.</span><span>out</span><span style="color:#000000">)</span></div><div style="margin:0px;line-height:normal;color:rgb(79,129,135)"><span>str</span><span style="color:#000000">.</span><span style="color:#3d1d81">write</span><span style="color:#000000">(to: &</span><span>StdStream</span><span style="color:#000000">.</span><span>err</span><span style="color:#000000">)</span></div><div><span style="color:#000000"><br></span></div></div></div><div>I also considered DarwinStream (seemed too on the nose), UnixStream, Streamfd, BSDStream, etc. Didn't like any of them.</div><div><br></div><div>-- E, have paintbrush will bikeshed</div></div></div><div style="word-wrap:break-word"><div><div><br></div><div><br><blockquote type="cite"><div>On Jul 11, 2016, at 12:58 PM, Saagar Jha via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br><div><div>Thanks, I’ll write it up.<br><blockquote type="cite">On Jul 11, 2016, at 11:20, Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br><br><br>on Sun Jul 10 2016, Saagar Jha <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br><br><blockquote type="cite">What is the process for smaller issues like these? I’m guessing that<br>this doesn’t need a proposal; where should it go? On <a href="http://bugs.swift.org" target="_blank">bugs.swift.org</a><br><<a href="http://bugs.swift.org/" target="_blank">http://bugs.swift.org/</a>>?<br></blockquote><br>If it adds an API, it needs a proposal. Doesn't necessarily have to be<br>a big proposal, and the review period can be short, but we don't add<br>APIs without the evolution process.<br><br>Thanks,<br>Dave<br><br>-- <br>Dave<br><br>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></blockquote><br>_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></div></blockquote></div><br></div></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>