[Rcpp-commits] r266 - in pkg: inst src src/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 3 21:58:49 CET 2010


Author: romain
Date: 2010-01-03 21:58:48 +0100 (Sun, 03 Jan 2010)
New Revision: 266

Modified:
   pkg/inst/ChangeLog
   pkg/src/Environment.cpp
   pkg/src/Rcpp/Environment.h
Log:
+Environment::parent()

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2010-01-03 20:52:36 UTC (rev 265)
+++ pkg/inst/ChangeLog	2010-01-03 20:58:48 UTC (rev 266)
@@ -1,5 +1,8 @@
 2010-01-03  Romain Francois <francoisromain at free.fr>
 
+	* src/Rcpp/Environment.h: Environment gains the parent
+	method that returns the parent environment
+	
 	* src/Rcpp/as.h: template as<> to convert SEXP to classic
 	C++ types, fcactored out of RObject
 	

Modified: pkg/src/Environment.cpp
===================================================================
--- pkg/src/Environment.cpp	2010-01-03 20:52:36 UTC (rev 265)
+++ pkg/src/Environment.cpp	2010-01-03 20:58:48 UTC (rev 266)
@@ -204,6 +204,10 @@
     	return s.val ;
     }
     
+    Environment Environment::parent() const throw() {
+    	return Environment( ENCLOS(m_sexp) ) ; 
+    }
+    
     /* exceptions */
     
     Environment::no_such_binding::no_such_binding(const std::string& binding) :

Modified: pkg/src/Rcpp/Environment.h
===================================================================
--- pkg/src/Rcpp/Environment.h	2010-01-03 20:52:36 UTC (rev 265)
+++ pkg/src/Rcpp/Environment.h	2010-01-03 20:58:48 UTC (rev 266)
@@ -302,6 +302,12 @@
      * @throw no_such_namespace 
      */
     static Environment namespace_env(const std::string& ) throw(no_such_namespace) ;
+    
+    /**
+     * The parent environment of this environment
+     */
+    Environment parent() const throw() ;
+    
 };
 
 } // namespace Rcpp



More information about the Rcpp-commits mailing list