Discover a new way to find and share stories you'll love… Learn about Reading Desk

Post Profile

Taming Your Sequence’s Side-Effects Through IEnumerable.Let

Introduction Side-effects don’t fit together very well with functional-style delayed computation, as observed in LINQ. Having such constructs embedded in an otherwise eagerly evaluated imperative language like C# can cause quite some confusion from time to time. A few samples (due to Erik Meijer) of such “mishaps” are shown below: // // When does it throw? // IEnumerable res = null; try {     res = from x in Enumerable.
read more


Copyright © 2011 Regator, LLC