Well, I tend to disagree on your point. You could use yield for adding power to C# that is not there in C++. Like LINQ capabilities, it's the support for a functional operator called "call-cc" (Call Current continuation), available in SCHEME a functional language. Suppose you need to traverse a tree and do something with it (print it in-order for instance). You could use a producer-consumer paradigm that keeps the function-stack low, thus memory use is reduced, but otherwise you have a very simple code to read. Something like: delegate ProducerFn; delegate ConsumerFn; public bool Producer(TreeNode t, delegate ConsumerFn) { foreach(TreeNode childNone in t.ChildNodes) { return yield ConsumerFn(t.left, Producer); } } public void Consumer(TreeNode t, delegate ProducerFn) { string str = String.Format(t.ToString()); yield ProducerFn(t, Consumer); } Well since this code will not work (yet) you only get the idea, but I will complete it later on. However, there's a good article for using yield at MSDN which you can see at the Visual Studio IDE as a suggested articles. If you execute and step over it, you may see these advantages. "If All you have is an hammer everything looks like a nail." -BARUCH's OBSERVATION, Murphy law bpsm74@sapo.pt
B
BRUNO S M
@BRUNO S M