Is there a way to pipeline program with random-access ranges in C#?

Dukc ajieskola at gmail.com
Wed Mar 21 07:40:01 UTC 2018


On Tuesday, 20 March 2018 at 15:57:16 UTC, Kagamin wrote:
> On Tuesday, 20 March 2018 at 15:06:14 UTC, Dukc wrote:
>> Won't quite do it, because that would not iterate backwards.
>
> Linq has no chunking, so you would need to write it, maybe 
> similar to SelectMany, but with the opposite meaning.
>
...except that IEnumerables cannot popBack(), so can only do that 
by doing an additional copy and reversing that. But I quess 
there's no better alternative, short of doing it C-style...

>
> If you want to have index, there's 
> https://msdn.microsoft.com/en-us/library/bb534869(v=vs.110).aspx

Wow, didn't know that. Thanks, It'll be useful.


More information about the Digitalmars-d-learn mailing list