Re:R, the master troll of statistical languages (2012)
by z92 on Wednesday February 17, 2016 @12:48AM
(#11115625)
The lookup thing only happens during compilation to byte code or intermediate code, I believe. Once in byte code, there are no variable names, only addresses.
[ Parent
| on HN ]
Re:R, the master troll of statistical languages (2012)
by klmr on Wednesday February 17, 2016 @06:25AM
(#11117070)
No, unfortunately that is not the case. Lookup happens at execution of the byte code, because variables cannot be looked up at byte compilation. Consider the following case:
x = 1
local({
assign(user_input, 2)
print(x)
}, envir = new.env(parent = environment()))
If `user_input` is “x”, the lookup of `x` in the local scope finds a different variable, in a different scope. Hence this lookup needs to take place every time this piece of code is executed.I’m not sure if Python suffers from similar problems.