-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add readLine
and readLineSlice
as methods to InStream
#3822
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
Comments
See: Line 125 in 4b6740e
Line 103 in 4b6740e
I think it's better this way as with a |
Agreed, but why does it make sense for
I don't follow. How is the assumed newline sequence a point in favor of standalone function versus method? |
I see why this was problematic now, |
FWIW this will all get much cleaner if the stream mixin concept is integrated. Currently discussion of Mixins is going on in #3785 |
I am closing this issue because it is no longer relevant. Standalone |
fwiw I think this is going to be satisfactorily solved in this branch |
Yeah, I kind of figured with the upcoming redesign. It makes sense that |
std.io.readLine
and friends are top-level functions that read from the stdin stream or passed-in stream.InStream
already has a wide variety of methods on it, and it seems inconsistent thatreadLine
would be top-level functions, while all the otherreadFoo
-style functions are methods onInStream
.If implemented, the top-level
readLine
functions could become wrappers for the new methods, and eventually be deprecated and removed.One of the nice things that
readLine
does is DRY thegetStdIn().inStream().stream
ceremony. Proposal #3823 addresses that.The text was updated successfully, but these errors were encountered: