www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18153] New: undocumented public structs ByLine, ByRecord,

https://issues.dlang.org/show_bug.cgi?id=18153

          Issue ID: 18153
           Summary: undocumented public structs ByLine, ByRecord, ByChunk
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: dkorpel live.nl

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.

--
Jan 02