Hello,
just a question; I need to do recurion on a sort of tree but I need to use 'yield' keyword as well. But recursion it seems don't work:
public IEnumerable compute(string query, string s) {
foreach (string s in Coll) {
query = .........................;
if () yield return compute(query, s);
}
}
This is a pseudo-code of course; I wonder if womething wrong in what I'm trying to do...
thanks
Loading
Nilanka DharmadasaPosted Nov 13, 2009, 5:44 AM
As I understand, you are not using the parametrs passed into the method. You are just using some fixed values defined inside the method. So, a recursion will not occur.
I cant be 100% sure about my answer as this pseudo code is not exactly clear for me.