Created
March 21, 2016 20:16
-
-
Save DeepSky8/fc67045fdbb041f4c513 to your computer and use it in GitHub Desktop.
Not sure how to populate the IEnumerable 'result'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Jacket | |
{ | |
static class Program | |
{ | |
static void Main(string[] args) | |
{ | |
} | |
public static IEnumerable<T3> Zipper<T1, T2, T3>(this IEnumerable<T1> first, IEnumerable<T2> second, Func<T1, T2, T3> f) | |
{ | |
IEnumerable<T3> result; | |
var FWalk = first.GetEnumerator(); | |
var SWalk = second.GetEnumerator(); | |
foreach (var item in first) | |
{ | |
FWalk.MoveNext(); | |
SWalk.MoveNext(); | |
f(FWalk.Current, SWalk.Current); | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment