I can not find too much materials about yield return. In MSDN sample,
what happens behind the scene of statement, "yield return result"?
I think what happens is a object instance which implements IEnumerable (collection pattern) interface is created (but what is the type of the instance? some C# internal type?), and each time "yield return result" is called, a new element is inserted into the internal array of the instance. Any more reference documents?
thanks in advance,
Clicking the first link on the page you gave is a page telling you what it does behind the scenes. Just two clicks further is a page telling you to look in your VS directory to find the C# language specification in your language and have a look at section 19 and 22. Do you need any more details, or did you just need somebody to do the clicking for you ? Really, please, learn to look stuff up. And don't full quote me.
I have also made some study from sample expansion of code from C# specification, at top of this page,
especially 10.14.6 implementation examples.
My current confusion is, I think the yield return grammar is of too flexibility, any ideas in what situation should we use it (in the implementation samples, it is used in for loop, while loop and foreach loop, too flexibility to grasp)?
Originally Posted by nvoigt
Like if that changed something...
And don't full quote me.
Hi vart, :-)
Any comments to my post #3?
Originally Posted by vart
have a good weekend,
What he probably meant to say was "make it idiot proof and someone will make a better idiot".
I don't think you read my text. Or you have serious problems understanding it. What was so hard about "don't full quote me" ? You are looking like someone who cannot use a forum (or any other form of internet communication) properly. I told you two times that quoting people in full makes you look like an idiot. Yet you do. You even quote me on it. I will not try again.
Go ahead and do dumb things, I will not help people who do not care.
Sorry for any in-convenience, nvoigt!
I will improve in the future. :-)