Skip to content

Commit

Permalink
Fix recursive gather/take
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Aug 10, 2010
1 parent c11c833 commit 6773107
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Kernel.cs
Expand Up @@ -424,19 +424,18 @@ public class Kernel {
}
}

public static Frame TakeReturnFrame;
public static Stack<Frame> TakeReturnStack = new Stack<Frame>();

public static Frame Take(Frame th, Variable payload) {
Frame r = TakeReturnFrame;
TakeReturnFrame = null;
Frame r = TakeReturnStack.Pop();
r.lex["$nextframe"] = NewROScalar(th);
r.resultSlot = payload;
th.resultSlot = payload;
return r;
}

public static Frame CoTake(Frame th, Frame from) {
TakeReturnFrame = th;
TakeReturnStack.Push(th);
return from;
}

Expand Down

0 comments on commit 6773107

Please sign in to comment.