lambda as default argument
<p>I was looking for an anwer to question <a href="http://stackoverflow.com/questions/3524415/get-next-n-elements-from-enumerable/11140231#11140231">Get next N elements from enumerable</a> didn't find any satisfying and brewed my own. What I came up with was</p>

<pre><code>IEnumerable&lt;T&gt; Chunk&lt;T, R&gt;(IEnumerable&lt;R&gt; src, int n, Func&lt;IEnumerable&lt;R&gt;, T&gt; action){
  IEnumerable&lt;R&gt; head;
  IEnumerable&lt;R&gt; tail = src;
  while (tail.Any())
  {
    head = tail.Take(n);
    tail = tail.Skip(n);
    yield return action(head);
  }
}
</code></pre>

<p>What I would really like though, is to have action have a default of <code>t=&gt;t</code>, but I can't figure out how to make that a default argument. The signature <code>IEnumerable&lt;T&gt; Chunk&lt;T, R&gt;(IEnumerable&lt;R&gt; src, int n, Func&lt;IEnumerable&lt;R&gt;, T&gt; action = t=&gt;t)</code> gives a syntax error.</p>

<p>My question is, how do I do this?</p>

<p>I suppose this is identical to <a href="http://stackoverflow.com/questions/6025118/specifying-a-lambda-function-as-default-argument">Specifying a lambda function as default argument</a> but for C# instead of C++</p>

<p>As a side note, I know it doesn't make any syntactical difference, but would it be easier to read if I switched <code>T</code> and <code>R</code>? </p>
