Displaying 1 result from an estimated 1 matches for "do_libfixup".
2001 Sep 16
1
Using closures in libraries
I was trying to use closures within a library as follows -
foo <- local({
# some code creating local variables
function() {
# uses the local variables created above
})
It did not work because call to do_libfixup in library replaces all
the closure environments by the global environment. One way around
this would be to do the replacement only for closures that have the
same environment as the package environment. Basically change the
relevant lines in envir.c (do_libfixup) with -
while (p != R_NilValue) {...