mesotron / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

Review: MoreEnumerable.While() #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Purpose of code changes on this branch:

Rev 138: Implementation of the While operator which consumes a sequence and
returns a projection of each element while some condition is true. Unlike
TakeWhile(), While supplies the condition delegate with the current and
previous element in the sequence, allowing conditions to be based on
changes between elements of the sequence. Wile operators in a deferred and
streaming manner.

When reviewing my code changes, please focus on:

* The public interface of the extension method.
* The effectiveness and clarity of the available XML comment documentation.
* How well this operator fits into the MoreLINQ ecosystem of
extension methods.
* The extent of coverage available from the corresponding unit tests.
* Whether edge cases are correctly identified and handled in the
implementation and tests.

After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by ambientl...@gmail.com on 23 Jan 2010 at 6:18

GoogleCodeExporter commented 9 years ago
Set review issue status to: Started

Original comment by azizatif on 23 Jan 2010 at 11:13

GoogleCodeExporter commented 9 years ago
Now migrated to Hg and available in clone:
http://code.google.com/r/azizatif-morelinq-evenmore/
This clone is ready to be cloned :O) for further review. It also has the 
main/default branch already merged in to bring it up to date.

Original comment by azizatif on 25 May 2012 at 11:38

GoogleCodeExporter commented 9 years ago
This can be implemented with Pairwise and TakeWhile, e.g.:

Enumerable.Range(1, 10)
          .Select(n => n * n )
          .Pairwise((a, b) => b - a)
          .TakeWhile(n => n < 10)

Original comment by azizatif on 9 Jun 2012 at 2:52