Skip to content

Instantly share code, notes, and snippets.

@joelmartinez
Created August 1, 2014 21:26

Revisions

  1. joelmartinez created this gist Aug 1, 2014.
    8 changes: 8 additions & 0 deletions iter.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    static class x10 {
    public static IEnumerable<T> Iter<T>(this IEnumerable<T> list, Action<T> action) {
    foreach (var n in list) {
    action (n);
    yield return n;
    }
    }
    }