Skip to content

the yield statement - not so mysterious after all?

Fri Apr 14 2006

[Via jfo's coding]

I'll admit, I haven't thought a whole lot about yield because, well, I couldn't find anything that described what it did in terms I could understand. I just kept thinking "oh, cool, another new feature in .net 2.0 that I'll get to learn by the time 3.0 comes out" and moved on to the next task.

Thinking about it as kind of a "macro" (similar to what a using(){} block does) lets it gel a little better.

💾 May the source be with you. v3.2.409