[Rd] The *tmp* variable

2013-07-06 Thread Peter Meilstrup
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

Re: [Rd] The *tmp* variable

2013-07-06 Thread Peter Meilstrup
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

Re: [Rd] The *tmp* variable

2013-07-07 Thread Bert Gunter
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

Re: [Rd] The *tmp* variable

2013-07-07 Thread Bert Gunter
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