std.algorithm.joiner unexpected behavior

Sergei Degtiarev via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 31 11:26:33 PDT 2017


Hi,
I tried to create a simple range concatenating several files, 
something like this:

	File[] files;
	....
	foreach(ln; joiner(files.map!(a => a.byLine)))
		writeln(ln);

and I see every first line of each file is missing.
However, when I do same thing with separator:

	char[][] separator=["**** new file ****".dup];
	foreach(ln; joiner(files.map!(a => a.byLine), separator))
		writeln(ln);

everything works fine, both separator and first lines are printed.
It looks pretty much as a bug for me, but I'm not sure I use it 
correctly.



More information about the Digitalmars-d-learn mailing list