-
Notifications
You must be signed in to change notification settings - Fork 131
TSCBasic: deprecate <<<
operator
#413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Since TSCBasic has become a kitchen sink for multiple types and functions, it's important to be able to selectively import those. It is done by `import struct` and similar statements. Unfortunately, this doesn't work for operators, which means you have to import the whole module when you need access just to a single operator. This inadvertently pollutes the environment of available symbols, which is undesirable. By deprecating the operator and adding a `send(_:)` function on `WritableByteStream` we allow selectively importing this functionality.
35a261b
to
6aa85be
Compare
@swift-ci test |
@swift-ci clean test |
SourceKit-LSP/SwiftSyntax CI breakage looks unrelated |
@swift-ci test macos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it time to deprecate ByteStream? this predates much of swift maturing on non-DArwin platforms and I am not sure it is still required
@swift-ci test windows |
@swift-ci test macos |
I hope it is, but it's used in a bunch of places in SwiftPM like logging that relies on Not something we have to have answers for this particular PR, these are more long-term questions. |
@swift-ci test macos |
1 similar comment
@swift-ci test macos |
Addresses some of the deprecations introduced in swiftlang/swift-tools-support-core#413
Addresses some of the deprecations introduced in swiftlang/swift-tools-support-core#413
Addresses some of the deprecations introduced in swiftlang/swift-tools-support-core#413
Addresses some of the deprecations introduced in swiftlang/swift-tools-support-core#413 Also using this as an opportunity to use string interpolation and raw string literals to make this more readable.
Since TSCBasic has become a kitchen sink for multiple types and functions, it's important to be able to selectively import those. It is done with
import struct
,import func
, and similar statements. Unfortunately, this doesn't work for operators, which means you have to import the whole module when you need access just to a single operator. This inadvertently pollutes the environment of available symbols, which is undesirable.By deprecating the operator and adding a
send(_:)
function onWritableByteStream
we allow selectively importing this functionality without importing the whole module.This also brings the API closer to Swift conventions, which in my understanding don't favor use of operators for stream I/O. Looks like
<<<
was initially brought over to TSC as a C++ idiom.