Timeline for Linq IEnumerable extensions for void functions
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 23, 2018 at 14:51 | comment | added | Pieter Witvoet |
What about foreach (var item in first.Zip(second, ...)) , where ... could produce a (value) tuple or an object of an existing or anonymous type? If used a lot, you could write a Zip extension method that doesn't require a Func<> argument. If it returned a value tuple, you could write foreach (var (item1, item2) in first.Zip(second)) .
|
|
Mar 23, 2018 at 14:41 | answer | added | Gert Arnold | timeline score: 8 | |
Mar 23, 2018 at 14:20 | comment | added | JAD | @PieterWitvoet If I have two enumerables and I want to map some method with side-effects to both, using a foreach loop is kind of a pain. I don't really see a straightforward way to accomplish that. | |
Mar 23, 2018 at 14:11 | comment | added | Pieter Witvoet |
Are you sure you want to mix functional programming with side effects? Why not use a foreach loop instead?
|
|
Mar 23, 2018 at 13:47 | answer | added | Jesse C. Slicer | timeline score: 2 | |
Mar 23, 2018 at 13:19 | history | asked | JAD | CC BY-SA 3.0 |