Skip to content
Prev 168442 / 398502 Next

evaluation revisited

Wacek Kusnierczyk wrote:
to be strict, the argument n to eval.parent is not further passed to
eval, and is evaluated before eval is called.  the above referred to the
'expr' argument to eval.parent.  one more example:

my.eval.parent = function(expr, n=1) {
    print('foo')
    p = parent.frame(n+1)
    eval(expr, p) }
trace(eval)
my.eval.parent({print('expr'); 1}, {print('n'); 1})
# "foo"
# "n"
# trace eval(expr, p)
# "expr"
# 1


vQ