Thanks, Peter. Now I get it.
It _was_ obvious!
-- Bert
On Sat, Jul 6, 2013 at 10:22 PM, Peter Meilstrup
wrote:
> The R interpreter does what it does at run time. The ambiguity is in
> reasoning at any time _other than run time_ which environment the returned
> value of 'x' is taken from.
>
> Th
Peter:
(Your function doesn't work -- you need to specify runif(1))
What ambiguity?
In the assignment within f(), x <- x+1,
the "x" on the rhs is a free variable in the function, and is
therefore looked for in the environment where the function was
defined. The x on the lhs is defined within th
The R interpreter does what it does at run time. The ambiguity is in
reasoning at any time _other than run time_ which environment the returned
value of 'x' is taken from.
This is one reason why R has been profiled to spend a significant amount of
time looking up names (
http://www.cs.purdue.edu/h
When complex assignments are performed, the R interpreter creates, then
removes a special variable *tmp*. However, when byte compiling is enabled,
it seems that a different mechanism for making compound assignments is used.
Would it be possible to eliminate *tmp* from interpreted R code as well? I