eval()
’s first argument is an expression. So if you only provide one argument, it will evaluate the expression in the current environment.
假設環境中存在變量 x=10
eval(quote(x), list(x=30))
相當於
首先,
quote(x)
得到x
之后,
list(x=30)
x
於是得到30
如果是eval(x, list(x=30))
, 相當於
首先,
x
得到10
之后,
list(x=30)
10
於是得到10
這里面有層層撥開的關系.