Skip to content
Prev 42860 / 63424 Next

enableJIT() and internal R completions (was: [ESS-bugs] ess-mode 12.03; ess hangs emacs)

The compiler/JIT is behaving as expected. The idea of compiling on
duplicate, which level 2 enables, is to address some idioms where
functions are modified at runtime.  Ideally it would be good to avoid
these idioms, and we may eventually get there, but for now they are an
issue.

In this particular case getAnywhere contains

         if (is.function(x))
             environment(x) <- baseenv()
         x

and the new function is duplicated and compiled in an lapply() call,
but the function doesn't make much sense with the baseenv()
environment, hence all the warnings.  This seems to be done so that
identical() can be used to compare functions and consider functions
that only differ in the environment to be edentical. It would probably
be better to do this in another more explicit way -- I'll look into
it.

(This does not occur in 2.4.1 because of a lack of duplicating bug in
lapply that has since been fixed.)

luke
On Wed, 21 Mar 2012, Vitalie Spinu wrote: