Rcpp11 / attributes

Standalone implementation of Rcpp attributes.
Other
3 stars 1 forks source link

restoring previous environment in sourceCpp #30

Open romainfrancois opened 10 years ago

romainfrancois commented 10 years ago

sourceCpp does not restore the environment after it is finished. We have:

if( length(ls(buildEnv)) )
      do.call( Sys.setenv, as.list(buildEnv) )

    owd <- setwd( tempdir() )
    on.exit( { setwd(owd) })

we should add something to on.exit to restore the environment to its previous state.