MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / remove

Function remove

inst/include/Rcpp/Environment.h:218–235  ·  view source on GitHub ↗

* remove an object from this environment */

Source from the content-addressed store, hash-verified

216 * remove an object from this environment
217 */
218 bool remove( const std::string& name ){
219 if( exists(name) ){
220 if( bindingIsLocked(name) ){
221 throw binding_is_locked(name) ;
222 } else{
223 /* unless we want to copy all of do_remove,
224 we have to go back to R to do this operation */
225 SEXP internalSym = Rf_install( ".Internal" );
226 SEXP removeSym = Rf_install( "remove" );
227 Shield<SEXP> str(Rf_mkString(name.c_str()));
228 Shield<SEXP> call(Rf_lang2(internalSym, Rf_lang4(removeSym, str, Storage::get__(), Rf_ScalarLogical(FALSE))));
229 Rcpp_fast_eval( call, R_GlobalEnv ) ;
230 }
231 } else{
232 throw no_such_binding(name) ;
233 }
234 return true;
235 }
236
237 /**
238 * locks this environment. See ?lockEnvironment

Callers 2

parseSourceDependenciesFunction · 0.85
commitMethod · 0.85

Calls 3

existsFunction · 0.85
bindingIsLockedFunction · 0.85
Rcpp_fast_evalFunction · 0.85

Tested by

no test coverage detected