move.frame(n, to) clear.frame(n)
clear.frame deletes frame n, because it is no longer needed by the frame that owns it. This recovers the space allocated for that frame and its contents.
# A function that evaluates 2 expressions and creates a frame # containing the list data, maybe updated by the two expressions. # Ownership is passed back to the caller of eval2() and the frame # number is returned as value.function eval2(expr1, expr2, data) { n <- new.frame(data) eval(expr1, n) eval(expr2, n) move.frame(n) n }