* Attempts to assign x to name in this environment * * @param name name of the object to assign * @param x object to assign * * @return true if the assign was successfull * see ?bindingIsLocked * * @throw binding_is_locked if the binding is locked */
| 183 | * @throw binding_is_locked if the binding is locked |
| 184 | */ |
| 185 | bool assign( const std::string& name, SEXP x ) const{ |
| 186 | if( exists( name) && bindingIsLocked(name) ) throw binding_is_locked(name) ; |
| 187 | SEXP nameSym = Rf_install(name.c_str()); |
| 188 | Rf_defineVar( nameSym, x, Storage::get__() ); |
| 189 | return true ; |
| 190 | } |
| 191 | |
| 192 | bool assign(const std::string& name, const Shield<SEXP>& x) const { |
| 193 | return assign(name, (SEXP) x); |
no test coverage detected