Bug 13657 – Bidirectional File.byLine range

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-10-25T16:28:03Z
Last change time
2024-12-01T16:22:49Z
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: phobos#10094 →

Comments

Comment #0 by bearophile_hugs — 2014-10-25T16:28:03Z
Currently this works as expected with dmd 2.067alpha: void main() { import std.stdio: writeln, File, stdin; import std.range: retro; import std.array: array; "test.d".File.byLine.array.retro.writeln; } But this: void main() { import std.stdio: writeln, File, stdin; import std.range: retro; "test.d".File.byLine.retro.writeln; } test.d(4,25): Error: template std.range.retro cannot deduce function from argument types !()(ByLine!(char, char)), candidates are: ...\dmd2\src\phobos\std\range.d(1966,6): std.range.retro(Range)(Range r) if (isBidirectionalRange!(Unqual!Range)) Perhaps File.byLine and File.byLineCopy can support reverse iteration of the lines of a file.
Comment #1 by bugzilla — 2020-01-03T13:47:05Z
Just a note: byLine.array is not supposed to work anyway. See issue 6495. But the main idea, namely to make byLine and byLineCopy bidirectional ranges, is still valid.
Comment #2 by robert.schadek — 2024-12-01T16:22:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10094 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB