3 ms·
“#zip”? Or maybe I’m misunderstanding the use case?
by akavi 7y ago
“#zip”?
Or maybe I’m misunderstanding the use case?
- naasking 7y agoWhich only works if the sequences align perfectly. Handling misaligned collections is more awkward with functional constructs. Functional graph programming is also still a bit of an open problem. There are awkward scenarios in both cases.
- akavi 7y agoAh, I see what you mean. Yeah, that’s always awkward Not sure how you deal with that with for loops either. Increment the iteration var in the body of the loop? (Seems scary to me, but like I said, I’ve got terrible intuition with them)
- naasking 7y agoFor something like iterators: var ie1 = foo.GetEnumerator(); var ie2 = bar.GetEnumerator(); while(true) { var has1 = ie1.MoveNext(); var has2 = ie2.MoveNext(); if (!has1 && !has2) break; if (has1) // do something with ie1.Current if (has2) // do something with ie2.Current }