Re: Consume an entire range

2013-05-30 Thread bearophile
Brad Anderson: Have any links? http://d.puremagic.com/issues/show_bug.cgi?id=9674 Is forEach real? It's just an idea. Bye, bearophile

Re: Consume an entire range

2013-05-30 Thread Jonathan M Davis
On Thursday, May 30, 2013 19:58:45 Brad Anderson wrote: > Is forEach real? I sought it out because it'd be a better fit > but came up empty (it's not in std.range or std.algorithm). No. The normal thing would be to just use an actual foreach loop. - Jonathan M Davis

Re: Consume an entire range

2013-05-30 Thread Brad Anderson
On Thursday, 30 May 2013 at 11:38:58 UTC, bearophile wrote: Brad Anderson: import std.stdio, std.algorithm, std.array; void eat(R)(R r) { while(!r.empty) { r.front; r.popFront; } } void main() { size_t[dstring] dic; stdin.byLine .joiner(" ") .array .splitt

Re: Consume an entire range

2013-05-30 Thread bearophile
Brad Anderson: import std.stdio, std.algorithm, std.array; void eat(R)(R r) { while(!r.empty) { r.front; r.popFront; } } void main() { size_t[dstring] dic; stdin.byLine .joiner(" ") .array .splitter(' ') .filter!(w => !w.empty && w !in dic)

Re: Consume an entire range

2013-05-29 Thread Brad Anderson
On Thursday, 30 May 2013 at 04:30:11 UTC, Brad Anderson wrote: [snip] import std.stdio, std.algorithm, std.array; void eat(R)(R r) { while(!r.empty) { r.front; r.popFront; } } void main() { size_t[dstring] dic; stdin.byLine .joiner(" ") .array .splitter('

Re: Consume an entire range

2013-05-29 Thread Brad Anderson
On Thursday, 30 May 2013 at 04:12:56 UTC, Diggory wrote: On Thursday, 30 May 2013 at 03:53:06 UTC, Brad Anderson wrote: On Thursday, 30 May 2013 at 03:50:52 UTC, Brad Anderson wrote: Is there a simple way to consume a range apart from std.array.array? I don't need to result of the range stored

Re: Consume an entire range

2013-05-29 Thread Brad Anderson
On Thursday, 30 May 2013 at 04:00:39 UTC, Jonathan M Davis wrote: On Thursday, May 30, 2013 05:53:02 Brad Anderson wrote: On Thursday, 30 May 2013 at 03:50:52 UTC, Brad Anderson wrote: > Is there a simple way to consume a range apart from > std.array.array? I don't need to result of the range s

Re: Consume an entire range

2013-05-29 Thread Diggory
On Thursday, 30 May 2013 at 04:18:14 UTC, Jonathan M Davis wrote: On Thursday, May 30, 2013 06:12:51 Diggory wrote: On Thursday, 30 May 2013 at 03:53:06 UTC, Brad Anderson wrote: > On Thursday, 30 May 2013 at 03:50:52 UTC, Brad Anderson > wrote: >> Is there a simple way to consume a range apar

Re: Consume an entire range

2013-05-29 Thread Jonathan M Davis
On Thursday, May 30, 2013 06:12:51 Diggory wrote: > On Thursday, 30 May 2013 at 03:53:06 UTC, Brad Anderson wrote: > > On Thursday, 30 May 2013 at 03:50:52 UTC, Brad Anderson wrote: > >> Is there a simple way to consume a range apart from > >> std.array.array? I don't need to result of the range s

Re: Consume an entire range

2013-05-29 Thread Diggory
On Thursday, 30 May 2013 at 03:53:06 UTC, Brad Anderson wrote: On Thursday, 30 May 2013 at 03:50:52 UTC, Brad Anderson wrote: Is there a simple way to consume a range apart from std.array.array? I don't need to result of the range stored in an array, I just need a lazy map to evaluate complete

Re: Consume an entire range

2013-05-29 Thread Jonathan M Davis
On Thursday, May 30, 2013 05:53:02 Brad Anderson wrote: > On Thursday, 30 May 2013 at 03:50:52 UTC, Brad Anderson wrote: > > Is there a simple way to consume a range apart from > > std.array.array? I don't need to result of the range stored in > > an array, I just need a lazy map to evaluate compl

Consume an entire range

2013-05-29 Thread Brad Anderson
Is there a simple way to consume a range apart from std.array.array? I don't need to result of the range stored in an array, I just need a lazy map to evaluate completely.

Re: Consume an entire range

2013-05-29 Thread Brad Anderson
On Thursday, 30 May 2013 at 03:50:52 UTC, Brad Anderson wrote: Is there a simple way to consume a range apart from std.array.array? I don't need to result of the range stored in an array, I just need a lazy map to evaluate completely. Obviously I could just popFront. To be more clear, I want