Refactoring C# Series: Aggregation of IEnumerable

I was recently reading this book about the Ruby programming language, and came across this piece of example code: [1,3,5,7].inject(0) {|sum, element| sum+element} -> 16 [1,3,5,7].inject(1) {|product, element| product*element} -> 105 Inject is a method which acts on an array by aggregating or accumulating the values within that array. It loops [...]

Lesen Sie den vollständigen Eintrag unter http://richardbushnell.net/index.php/2008/03/02/refactoring-c-series-aggregation-of-ienumerable/

Published Sonntag, 2. März 2008 21:54 von .Net Smoothie