[Rcpp-commits] r1157 - pkg/Rcpp pkg/Rcpp/inst pkg/Rcpp/inst/announce pkg/Rcpp/inst/include/Rcpp scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 4 10:13:41 CEST 2010


Author: romain
Date: 2010-05-04 10:13:40 +0200 (Tue, 04 May 2010)
New Revision: 1157

Modified:
   pkg/Rcpp/NEWS
   pkg/Rcpp/inst/ChangeLog
   pkg/Rcpp/inst/announce/ANNOUNCE-0.8.0.txt
   pkg/Rcpp/inst/include/Rcpp/preprocessor_generated.h
   scripts/preprocessor.R
Log:
documenting the code generation macros

Modified: pkg/Rcpp/NEWS
===================================================================
--- pkg/Rcpp/NEWS	2010-05-04 06:25:34 UTC (rev 1156)
+++ pkg/Rcpp/NEWS	2010-05-04 08:13:40 UTC (rev 1157)
@@ -21,6 +21,59 @@
 	// user code
 	END_RCPP
 	
+	o   new __experimental__ macros 
+	
+	The macros RCPP_FUNCTION_0, ..., RCPP_FUNCTION_65 to help creating c++
+	functions hiding some code repetition: 
+	
+	RCPP_FUNCTION_2( int, foobar, int x, int y){
+		return x + y ;
+	}
+
+	The first argument is the output type, the second argument is the 
+	name of the function, and the other arguments are arguments of the C++ 
+	function. Behind the scenes, the RCPP_FUNCTION_2 macro creates 
+	an intermediate function compatible with the .Call interface and handles 
+	exceptions
+	
+	
+	Similarly, the macros RCPP_FUNCTION_VOID_0, ..., RCPP_FUNCTION_VOID_65
+	can be used when the C++ function to create returns void. The generated R
+	function will return R_NilValue in this case. 
+	
+	RCPP_FUNCTION_VOID_2( foobar, std::string foo ){
+		// do something with foo
+	}
+
+	
+	The macros RCPP_XP_METHOD_0, ..., RCPP_XP_METHOD_65 faciliate 
+	calling a method of an object that is stored in an external pointer. For 
+	example: 
+	
+	RCPP_XP_METHOD_0( foobar, std::vector<int> , size )
+	
+	creates the .Call compatible function called foobar that calls the size
+	method of the std::vector<int> class. This uses the Rcpp::XPtr< std::vector<int> >
+	class.
+	
+	
+	The macros RCPP_XP_METHOD_CAST_0, ... is similar but the result of the method 
+	called is first passed to another function before being wrapped to a SEXP.
+	For example, if one wanted the result as a double
+	
+	RCPP_XP_METHOD_CAST_0( foobar, std::vector<int> , size, double )
+	
+	
+	The macros RCPP_XP_METHOD_VOID_0, ... are used when calling the method 
+	is only used for its side effect. 
+	
+	RCPP_XP_METHOD_VOID_1( foobar, std::vector<int>, push_back ) 
+	
+	Assuming xp is an external pointer to a std::vector<int>, this could be 
+	called like this :
+	
+	.Call( "foobar", xp, 2L )
+	
 	o	Rcpp now depends on inline (>= 0.3.4)
 	
 	o	new R function "cppfunction" that invokes cfunction from inline with 

Modified: pkg/Rcpp/inst/ChangeLog
===================================================================
--- pkg/Rcpp/inst/ChangeLog	2010-05-04 06:25:34 UTC (rev 1156)
+++ pkg/Rcpp/inst/ChangeLog	2010-05-04 08:13:40 UTC (rev 1157)
@@ -1,3 +1,14 @@
+2010-05-04  Romain Francois <romain at r-enthusiasts.com>
+
+	* inst/include/Rcpp/preprocessor_generated.h: new macros to hide most of 
+	the boiler plate code
+	
+	RCPP_FUNCTION_0, ..., RCPP_FUNCTION_1
+	RCPP_FUNCTION_VOID_0, ...
+	RCPP_XP_METHOD_0, ...
+	RCPP_XP_METHOD_CAST_0, ...
+	RCPP_XP_METHOD_VOID_0, ...
+
 2010-05-03  Dirk Eddelbuettel  <edd at dexter>
 
 	* inst/unitTests/runit.DataFrame.R: unit tests for Rcpp::DataFrame

Modified: pkg/Rcpp/inst/announce/ANNOUNCE-0.8.0.txt
===================================================================
--- pkg/Rcpp/inst/announce/ANNOUNCE-0.8.0.txt	2010-05-04 06:25:34 UTC (rev 1156)
+++ pkg/Rcpp/inst/announce/ANNOUNCE-0.8.0.txt	2010-05-04 08:13:40 UTC (rev 1157)
@@ -208,6 +208,32 @@
 exceptions later.
 
 
+===== Experimental code generation macros =====
+
+Rcpp contains various macros that generate boilter plate code. 
+RCPP_FUNCTION_0, ..., RCPP_FUNCTION_65
+RCPP_FUNCTION_VOID_0, ..., RCPP_FUNCTION_VOID_65
+RCPP_XP_METHOD_0, ..., RCPP_XP_METHOD_65
+RCPP_XP_METHOD_CAST_0, ..., RCPP_XP_METHOD_CAST_65
+RCPP_XP_METHOD_VOID_0, ..., RCPP_XP_METHOD_VOID_65
+
+For example: 
+
+	RCPP_FUNCTION_2( int, foobar, int x, int y){
+		return x + y ;
+	}
+
+This will create a .Call compatible function "foobar" that calls a 
+c++ function for which we provide the argument list (int x, int y)
+and the return type (int). The macro also encloses the call 
+in BEGIN_RCPP/END_RCPP so that exceptions are properly forwarded to R.
+
+Examples of the other macros are given in the NEWS file.
+
+This feature is still experimental, but is being used in packages
+highlight and RProtoBuf
+
+
 ===== Quality Assurance =====
 
 Rcpp uses the RUnit package by Matthias Burger et al and the aforementioned

Modified: pkg/Rcpp/inst/include/Rcpp/preprocessor_generated.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/preprocessor_generated.h	2010-05-04 06:25:34 UTC (rev 1156)
+++ pkg/Rcpp/inst/include/Rcpp/preprocessor_generated.h	2010-05-04 08:13:40 UTC (rev 1157)
@@ -28,12 +28,14 @@
 #define RCPP_FUNCTION_0(__OUT__,__NAME__)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 0 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)() ;               \
 extern "C" SEXP __NAME__(){                       \
@@ -48,12 +50,14 @@
 #define RCPP_FUNCTION_1(__OUT__,__NAME__, ___0)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 1 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0) ;               \
 extern "C" SEXP __NAME__(SEXP x0){                       \
@@ -68,12 +72,14 @@
 #define RCPP_FUNCTION_2(__OUT__,__NAME__, ___0, ___1)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 2 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1){                       \
@@ -88,12 +94,14 @@
 #define RCPP_FUNCTION_3(__OUT__,__NAME__, ___0, ___1, ___2)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 3 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2){                       \
@@ -108,12 +116,14 @@
 #define RCPP_FUNCTION_4(__OUT__,__NAME__, ___0, ___1, ___2, ___3)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 4 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3){                       \
@@ -128,12 +138,14 @@
 #define RCPP_FUNCTION_5(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 5 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4){                       \
@@ -148,12 +160,14 @@
 #define RCPP_FUNCTION_6(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 6 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5){                       \
@@ -168,12 +182,14 @@
 #define RCPP_FUNCTION_7(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 7 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6){                       \
@@ -188,12 +204,14 @@
 #define RCPP_FUNCTION_8(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 8 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7){                       \
@@ -208,12 +226,14 @@
 #define RCPP_FUNCTION_9(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 9 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8){                       \
@@ -228,12 +248,14 @@
 #define RCPP_FUNCTION_10(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 10 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9){                       \
@@ -248,12 +270,14 @@
 #define RCPP_FUNCTION_11(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 11 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10){                       \
@@ -268,12 +292,14 @@
 #define RCPP_FUNCTION_12(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 12 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11){                       \
@@ -288,12 +314,14 @@
 #define RCPP_FUNCTION_13(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 13 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12){                       \
@@ -308,12 +336,14 @@
 #define RCPP_FUNCTION_14(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 14 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13){                       \
@@ -328,12 +358,14 @@
 #define RCPP_FUNCTION_15(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 15 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14){                       \
@@ -348,12 +380,14 @@
 #define RCPP_FUNCTION_16(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 16 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15){                       \
@@ -368,12 +402,14 @@
 #define RCPP_FUNCTION_17(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 17 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15, SEXP x16){                       \
@@ -388,12 +424,14 @@
 #define RCPP_FUNCTION_18(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 18 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16, #___17                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15, SEXP x16, SEXP x17){                       \
@@ -408,12 +446,14 @@
 #define RCPP_FUNCTION_19(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 19 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16, #___17, #___18                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15, SEXP x16, SEXP x17, SEXP x18){                       \
@@ -428,12 +468,14 @@
 #define RCPP_FUNCTION_20(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 20 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16, #___17, #___18, #___19                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15, SEXP x16, SEXP x17, SEXP x18, SEXP x19){                       \
@@ -448,12 +490,14 @@
 #define RCPP_FUNCTION_21(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19, ___20)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 21 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16, #___17, #___18, #___19, #___20                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19, ___20) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15, SEXP x16, SEXP x17, SEXP x18, SEXP x19, SEXP x20){                       \
@@ -468,12 +512,14 @@
 #define RCPP_FUNCTION_22(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19, ___20, ___21)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 22 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16, #___17, #___18, #___19, #___20, #___21                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19, ___20, ___21) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15, SEXP x16, SEXP x17, SEXP x18, SEXP x19, SEXP x20, SEXP x21){                       \
@@ -488,12 +534,14 @@
 #define RCPP_FUNCTION_23(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19, ___20, ___21, ___22)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 23 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16, #___17, #___18, #___19, #___20, #___21, #___22                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
+    return info ;                                   \
 }                                                   \
 __OUT__ RCPP_DECORATE(__NAME__)(___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19, ___20, ___21, ___22) ;               \
 extern "C" SEXP __NAME__(SEXP x0, SEXP x1, SEXP x2, SEXP x3, SEXP x4, SEXP x5, SEXP x6, SEXP x7, SEXP x8, SEXP x9, SEXP x10, SEXP x11, SEXP x12, SEXP x13, SEXP x14, SEXP x15, SEXP x16, SEXP x17, SEXP x18, SEXP x19, SEXP x20, SEXP x21, SEXP x22){                       \
@@ -508,12 +556,14 @@
 #define RCPP_FUNCTION_24(__OUT__,__NAME__, ___0, ___1, ___2, ___3, ___4, ___5, ___6, ___7, ___8, ___9, ___10, ___11, ___12, ___13, ___14, ___15, ___16, ___17, ___18, ___19, ___20, ___21, ___22, ___23)        \
 extern "C" SEXP __NAME__##__rcpp_info__( ){         \
     using Rcpp::_ ;                                 \
-	return Rcpp::List::create(                      \
+	Rcpp::List info = Rcpp::List::create(           \
         _["n"]   = 24 ,                             \
         _["out"] = #__OUT__ ,                       \
         _["in"]  = Rcpp::CharacterVector::create(   \
         	#___0, #___1, #___2, #___3, #___4, #___5, #___6, #___7, #___8, #___9, #___10, #___11, #___12, #___13, #___14, #___15, #___16, #___17, #___18, #___19, #___20, #___21, #___22, #___23                                       \
         	) ) ;                                    \
+    info.attr( "class" ) = "rcppfunctioninfo" ;      \
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/rcpp -r 1157


More information about the Rcpp-commits mailing list