Re: input range from stdin

2014-09-18 Thread Ali Çehreli via Digitalmars-d-learn
On 09/18/2014 11:22 AM, Ali Çehreli wrote: And quietly ignored And *I* quietly ignored Ali

Re: input range from stdin

2014-09-18 Thread Ali Çehreli via Digitalmars-d-learn
On 09/18/2014 02:21 AM, krzaq wrote: > That's not what I wanted. Maybe I should explain instead of expecting > you to divine my intentions, though :) And quietly ignored some of the things you were doing. :) For example, I did not think it was necessary to fill an existing array when the range

Re: input range from stdin

2014-09-18 Thread via Digitalmars-d-learn
On Thursday, 18 September 2014 at 13:10:06 UTC, krzaq wrote: I guess this works for now http://dpaste.dzfl.pl/6801615160e3 I have a follow-up question: why does zip not accept an array? Because (fixed-sized) arrays don't have a range interface (empty, front & popFront()), in particular, popFr

Re: input range from stdin

2014-09-18 Thread krzaq via Digitalmars-d-learn
On Thursday, 18 September 2014 at 11:13:36 UTC, Marc Schütz wrote: On Thursday, 18 September 2014 at 09:21:17 UTC, krzaq wrote: That's not what I wanted. Maybe I should explain instead of expecting you to divine my intentions, though :) I am trying to rewrite the following program in D--making

Re: input range from stdin

2014-09-18 Thread via Digitalmars-d-learn
On Thursday, 18 September 2014 at 09:21:17 UTC, krzaq wrote: That's not what I wanted. Maybe I should explain instead of expecting you to divine my intentions, though :) I am trying to rewrite the following program in D--making it more elegant: http://melpon.org/wandbox/permlink/ff42FoyKgqJK60s

Re: input range from stdin

2014-09-18 Thread krzaq via Digitalmars-d-learn
On Wednesday, 17 September 2014 at 18:05:36 UTC, Ali Çehreli wrote: On 09/17/2014 08:30 AM, krzaq wrote: On Wednesday, 17 September 2014 at 14:37:21 UTC, Marc Schütz wrote: On Wednesday, 17 September 2014 at 12:44:00 UTC, krzaq wrote: I'd like to have something similar to C++'s std::istream_it

Re: input range from stdin

2014-09-17 Thread Ali Çehreli via Digitalmars-d-learn
On 09/17/2014 08:30 AM, krzaq wrote: On Wednesday, 17 September 2014 at 14:37:21 UTC, Marc Schütz wrote: On Wednesday, 17 September 2014 at 12:44:00 UTC, krzaq wrote: I'd like to have something similar to C++'s std::istream_iterator(std::cin) Is it possible? I'm relatively indifferent to effic

Re: input range from stdin

2014-09-17 Thread krzaq via Digitalmars-d-learn
On Wednesday, 17 September 2014 at 14:37:21 UTC, Marc Schütz wrote: On Wednesday, 17 September 2014 at 12:44:00 UTC, krzaq wrote: I'd like to have something similar to C++'s std::istream_iterator(std::cin) Is it possible? I'm relatively indifferent to efficiency of the solution. import std.

Re: input range from stdin

2014-09-17 Thread via Digitalmars-d-learn
On Wednesday, 17 September 2014 at 12:44:00 UTC, krzaq wrote: I'd like to have something similar to C++'s std::istream_iterator(std::cin) Is it possible? I'm relatively indifferent to efficiency of the solution. import std.stdio; import std.algorithm; import std.conv; writeln(stdin.byLine.ma

input range from stdin

2014-09-17 Thread krzaq via Digitalmars-d-learn
I'd like to have something similar to C++'s std::istream_iterator(std::cin) Is it possible? I'm relatively indifferent to efficiency of the solution.