Wednesday, August 13, 2008

Yield and prepare to be enumerated!

Raymond Chen has written an illuminating blog post on what *actually* happens when you write an iterator in C#.

This explains clearly what’s going on – essential for getting your head around how to use them, and in particular the yield return and yield break statements.

Start Leeks linked to it as part of his series covering yield.

Syntactic sugar:

Update: Raymond has a posted two follow-up articles.

No comments: