[Rinside-commits] r110 - in pkg: inst inst/examples/standard src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 24 00:18:10 CET 2010


Author: edd
Date: 2010-02-24 00:18:10 +0100 (Wed, 24 Feb 2010)
New Revision: 110

Modified:
   pkg/inst/ChangeLog
   pkg/inst/examples/standard/rinside_sample8.cpp
   pkg/src/RInside.cpp
   pkg/src/RInside.h
Log:
new parseEval() returning SEXP


Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2010-02-19 04:25:56 UTC (rev 109)
+++ pkg/inst/ChangeLog	2010-02-23 23:18:10 UTC (rev 110)
@@ -1,3 +1,15 @@
+2010-02-23  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/RInside.cpp: Add new parseEval() member function returning a SEXP
+	* src/RInside.h: idem
+
+	* src/inst/examples/standard/rinside_sample8.cpp: Show new parseEval()
+
+2010-02-17  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/examples/mpi/: Add examples contributed by Jianping Hua
+	* inst/examples/: Update two existing examples to new Rcpp API
+
 2010-02-12  Romain Francois <romain at r-enthusiasts.com>
 
 	* src/MemBuf.h: MemBuf simplified using std::string
@@ -11,14 +23,14 @@
 
 	* RInside::autoloads revisited with the new Rcpp api
 
-	* RInside gains a default constructor to be used when there 
+	* RInside gains a default constructor to be used when there
 	is no command line arguments
-	
+
 2010-01-28  Romain Francois <francoisromain at free.fr>
 
 	* src/RInside.{h,cpp}: Retire assign(vector<vector<double>> )
 	because now this can be taken care of by template specialization
-	
+
 	* DESCRIPTION: require Rcpp 0.7.3.6
 
 2010-01-28  Dirk Eddelbuettel  <edd at debian.org>

Modified: pkg/inst/examples/standard/rinside_sample8.cpp
===================================================================
--- pkg/inst/examples/standard/rinside_sample8.cpp	2010-02-19 04:25:56 UTC (rev 109)
+++ pkg/inst/examples/standard/rinside_sample8.cpp	2010-02-23 23:18:10 UTC (rev 110)
@@ -17,6 +17,10 @@
     int sum = Rcpp::as<int>( R["z"] ); 
   
     std::cout << "10 + 20 = " << sum << std::endl ; 
+
+    sum = Rcpp::as<int>( R.parseEval("z <- x + y") ); 
+    std::cout << "10 + 20 = " << sum << std::endl ; 
+
     exit(0);
 }
 

Modified: pkg/src/RInside.cpp
===================================================================
--- pkg/src/RInside.cpp	2010-02-19 04:25:56 UTC (rev 109)
+++ pkg/src/RInside.cpp	2010-02-23 23:18:10 UTC (rev 110)
@@ -291,6 +291,12 @@
     return rc;
 }
 
+SEXP RInside::parseEval(const std::string & line) {
+    SEXP ans;
+    int rc = parseEval(line, ans);
+    return ans;
+}
+
 Rcpp::Environment::Binding RInside::operator[]( const std::string& name ){
 	return global_env[name]; 
 }

Modified: pkg/src/RInside.h
===================================================================
--- pkg/src/RInside.h	2010-02-19 04:25:56 UTC (rev 109)
+++ pkg/src/RInside.h	2010-02-23 23:18:10 UTC (rev 110)
@@ -57,6 +57,7 @@
 public:
     int parseEval(const std::string & line, SEXP &ans);
     int parseEvalQ(const std::string & line);
+    SEXP parseEval(const std::string & line);
 
     template <typename T>
     void assign(const T& object, const std::string& nam){



More information about the Rinside-commits mailing list