Bug 18153 – deprecate public symbols ByLine, ByRecord, ByChunk

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-01-02T23:06:30Z
Last change time
2018-01-03T00:53:52Z
Keywords
pull
Assigned to
Seb
Creator
Dennis

Comments

Comment #0 by dkorpel — 2018-01-02T23:06:30Z
I accidentily wrote this code: import std.stdio; foreach(line; File(fileName, "r").ByLine) { ... } And got this confusing error: Error: cannot resolve type for ((File __slFile908 = File(null, null);) , __slFile908).this(fileName, "r").ByLine(Char, Terminator) It turns out I wasn't calling the method 'byLine' but the constructor of the struct 'ByLine'. Is there any reason the struct ByLine, as well as ByChunk and ByRecord, are public? I can't find any documentation on them. I suggest either making them private (like ByLineCopy), or documenting their use.
Comment #1 by greensunny12 — 2018-01-02T23:22:26Z
Have a look here: https://github.com/dlang/phobos/blob/master/std/stdio.d#L2070 A long time ago ByLine and friends used to be publicly documented. However, it was realized that this is a mistake and thus only undocumented. > suggest either making them private (like ByLineCopy) Yes, that's the way to move forward. It can be done with sth. like this: ``` deprecated("Use .byLine") alias ByLine = ByLineImpl; ```
Comment #2 by greensunny12 — 2018-01-02T23:22:49Z
Comment #3 by github-bugzilla — 2018-01-03T00:53:51Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/d33e7df1ca92dd0f60010dd79357232c50bfe2ec Fix Issue 18153 - deprecate public symbols ByLine, ByRecord, ByChunk https://github.com/dlang/phobos/commit/e7f68bf5332d742334f8844933bfcabbfe56dc39 Merge pull request #5982 from wilzbach/fix-18153 Fix Issue 18153 - deprecate public symbols ByLine, ByRecord, ByChunk merged-on-behalf-of: Steven Schveighoffer <[email protected]>