Skip to content
Prev 5883 / 63424 Next

bug in eval

Deepayan Sarkar <deepayan@stat.wisc.edu> writes:
Nope. This is not a bug, just confusing. The thing to note is that
default expressions are evaluated in the frame of the called function.
I.e. the parent.frame() referred to as the default for envir in eval()
is the caller of eval, whereas in eval(expr, parent.frame()) the
parent.frame() is evaluated in the callers frame, giving you the
grandparent of the eval call.