Re: std.range.chunk without length

2014-02-18 Thread Stephan Schiffels
On Thursday, 13 February 2014 at 17:41:37 UTC, monarch_dodra wrote: On Thursday, 13 February 2014 at 14:45:44 UTC, bearophile wrote: Stephan Schiffels: It would be actually easy to implement chunks without the save function, by using an internal buffer, which would however make this

Re: std.range.chunk without length

2014-02-13 Thread Stephan Schiffels
On Thursday, 31 October 2013 at 10:35:54 UTC, Stephan Schiffels wrote: On Wednesday, 30 October 2013 at 20:43:54 UTC, qznc wrote: On Wednesday, 30 October 2013 at 00:20:12 UTC, Stephan Schiffels wrote: Hi, I'd like a version of std.range.chunk that does not require the range to have the

Re: std.range.chunk without length

2014-02-13 Thread bearophile
Stephan Schiffels: It would be actually easy to implement chunks without the save function, by using an internal buffer, which would however make this algorithm's memory burden linear in the chunk size. Would that be acceptable? I think it's acceptable. But perhaps you need to add one more

Re: std.range.chunk without length

2014-02-13 Thread monarch_dodra
On Thursday, 13 February 2014 at 14:45:44 UTC, bearophile wrote: Stephan Schiffels: It would be actually easy to implement chunks without the save function, by using an internal buffer, which would however make this algorithm's memory burden linear in the chunk size. Would that be

Re: std.range.chunk without length

2013-10-31 Thread Stephan Schiffels
On Wednesday, 30 October 2013 at 20:43:54 UTC, qznc wrote: On Wednesday, 30 October 2013 at 00:20:12 UTC, Stephan Schiffels wrote: Hi, I'd like a version of std.range.chunk that does not require the range to have the length property. As an example, consider a file that you would like parse

Re: std.range.chunk without length

2013-10-30 Thread qznc
On Wednesday, 30 October 2013 at 00:20:12 UTC, Stephan Schiffels wrote: Hi, I'd like a version of std.range.chunk that does not require the range to have the length property. As an example, consider a file that you would like parse by lines and always lump together four lines, i.e. import

std.range.chunk without length

2013-10-29 Thread Stephan Schiffels
Hi, I'd like a version of std.range.chunk that does not require the range to have the length property. As an example, consider a file that you would like parse by lines and always lump together four lines, i.e. import std.stdio; void main() { auto range = File(test.txt, r).byLine();