[Rcpp-commits] r902 - in pkg/Rcpp: . inst inst/codebloat inst/unitTests src/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 15 18:57:31 CET 2010


Author: romain
Date: 2010-03-15 18:57:31 +0100 (Mon, 15 Mar 2010)
New Revision: 902

Added:
   pkg/Rcpp/inst/codebloat/
   pkg/Rcpp/inst/codebloat/codebloat.R
Modified:
   pkg/Rcpp/DESCRIPTION
   pkg/Rcpp/NEWS
   pkg/Rcpp/inst/ChangeLog
   pkg/Rcpp/inst/unitTests/runit.S4.R
   pkg/Rcpp/src/Rcpp/DottedPair.h
   pkg/Rcpp/src/Rcpp/Function.h
   pkg/Rcpp/src/Rcpp/Language.h
   pkg/Rcpp/src/Rcpp/Pairlist.h
   pkg/Rcpp/src/Rcpp/grow.h
Log:
maximum # of arguments is upgraded to 20 (thanks to new codebloat script)

Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION	2010-03-15 13:07:03 UTC (rev 901)
+++ pkg/Rcpp/DESCRIPTION	2010-03-15 17:57:31 UTC (rev 902)
@@ -1,9 +1,9 @@
 Package: Rcpp
 Title: Rcpp R/C++ interface package
-Version: 0.7.9.2
+Version: 0.7.9.3
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois, with contributions 
- by Simon Urbanek and David Reiss; based on code written during 
+ by Simon Urbanek, David Reiss and Douglas Bates; based on code written during 
  2005 and 2006 by Dominick Samperi 
 Maintainer: Dirk Eddelbuettel and Romain Francois <RomainAndDirk at r-enthusiasts.com>
 Description: Seamless R and C++ integration

Modified: pkg/Rcpp/NEWS
===================================================================
--- pkg/Rcpp/NEWS	2010-03-15 13:07:03 UTC (rev 901)
+++ pkg/Rcpp/NEWS	2010-03-15 17:57:31 UTC (rev 902)
@@ -2,6 +2,11 @@
 0.7.10  (under development)
 
 	o	new class Rcpp::S4 whose constructor checks if the object is an S4 object
+	
+	o	maximum number of templated arguments to the pairlist function, 
+		the DottedPair constructor, the Language constructor and the 
+		Pairlist constructor has been updated to 20 (was 5) and a script has been
+		added to the source tree should we want to change it again
 
 0.7.9   2010-03-12
 

Modified: pkg/Rcpp/inst/ChangeLog
===================================================================
--- pkg/Rcpp/inst/ChangeLog	2010-03-15 13:07:03 UTC (rev 901)
+++ pkg/Rcpp/inst/ChangeLog	2010-03-15 17:57:31 UTC (rev 902)
@@ -1,5 +1,8 @@
 2010-03-15  Romain Francois <romain at r-enthusiasts.com>
 
+	* inst/codebloat/codebloat.R: script to generate code (creating a pairlist
+	with up to n arguments).
+
 	* src/Rcpp/Function.h : Function gains a body method to retrieve the body
 	of the function (using the BODY macro from Rinternals.h)
 

Added: pkg/Rcpp/inst/codebloat/codebloat.R
===================================================================
--- pkg/Rcpp/inst/codebloat/codebloat.R	                        (rev 0)
+++ pkg/Rcpp/inst/codebloat/codebloat.R	2010-03-15 17:57:31 UTC (rev 902)
@@ -0,0 +1,70 @@
+
+#
+# to change the maximum number of arguments to 20
+# move to the root directory of Rcpp and do : 
+# Rscript inst/codebloat/codebloat.R 20
+#
+
+target <- commandArgs(TRUE)[1]
+
+typenames <- function( n = 1){
+	paste( sprintf( "typename T%d", 1:n ), collapse = ", " )
+}
+
+arguments <- function( n = 1){
+	paste( sprintf( "const T%d& t%d", 1:n, 1:n ), collapse = ", " )	
+}
+
+parameters <- function( n = 1 ){
+	paste( sprintf( "t%d", 1:n ), collapse = ", " )	
+}
+
+grow <- function( n = 1 ){
+	grow__ <- function( n, m){
+		if( m > n ){
+			"R_NilValue"
+		} else{
+			sprintf( "grow( t%d, %s )", m, grow__( n , m+1) )	
+		}
+	}
+	grow__( n, 1 ) ;
+}
+
+modify <- function(txt, token, n, fun){
+	if( any( grepl( token, txt ) ) ){
+		gsub( token, fun(n), txt )
+	} else {
+		txt
+	}
+}
+
+path <- file.path( "src", "Rcpp" )
+for( f in list.files(path, full.names = TRUE) ){
+	content <- readLines( f )
+	if( any( grepl( "code-bloat", content ) ) ){
+		first <- grep( "<code-bloat>", content )
+		last <- grep( "</code-bloat>", content )
+		code.end <- grep( "^[*]/", content[first:last] )[1] - 2
+		code <- content[ first + (2:code.end) ]
+		
+		result <- lapply( 1:target, function(n){
+			txt <- code
+			txt <- modify( txt, "TYPENAMES" , n, typenames  )
+			txt <- modify( txt, "ARGUMENTS" , n, arguments  )
+			txt <- modify( txt, "PARAMETERS", n, parameters )
+			txt <- modify( txt, "GROW"      , n, grow )
+			txt
+		} )
+		
+		output <- unlist( result )
+		
+		new.content <- c( 
+			content[1:(first+code.end+1)], 
+			output, 
+			content[last:length(content)] )
+		
+		cat( new.content, file = f, sep = "\n" )
+			
+	}
+}
+

Modified: pkg/Rcpp/inst/unitTests/runit.S4.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.S4.R	2010-03-15 13:07:03 UTC (rev 901)
+++ pkg/Rcpp/inst/unitTests/runit.S4.R	2010-03-15 17:57:31 UTC (rev 902)
@@ -82,7 +82,7 @@
 		'
 		std::string cl = as<std::string>( clazz );
 		return S4( cl ); 
-		', includes = "using namespace Rcpp" )
+		', Rcpp = TRUE, includes = "using namespace Rcpp ;" )
 	tr <- fx( "track" )
 	checkTrue( inherits( tr, "track" ) )
 	checkEquals( tr at x, 0.0 )

Modified: pkg/Rcpp/src/Rcpp/DottedPair.h
===================================================================
--- pkg/Rcpp/src/Rcpp/DottedPair.h	2010-03-15 13:07:03 UTC (rev 901)
+++ pkg/Rcpp/src/Rcpp/DottedPair.h	2010-03-15 17:57:31 UTC (rev 902)
@@ -50,27 +50,114 @@
 		setSEXP( pairlist(args...) ) ;
 	}
 #else
-/* <code-bloat> */
-template <typename T1>
-DottedPair( const T1& t1) : RObject() {
-	setSEXP( pairlist(t1) );
-}
-template <typename T1, typename T2>
-DottedPair( const T1& t1, const T2& t2) : RObject(){
-	setSEXP( pairlist(t1,t2) ); 
-}
-template <typename T1, typename T2, typename T3>
-DottedPair( const T1& t1, const T2& t2, const T3& t3): RObject() {
-	setSEXP( pairlist(t1,t2,t3) );
-}
-template <typename T1, typename T2, typename T3, typename T4>
-DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4): RObject(){
-	setSEXP( pairlist(t1,t2,t3,t4) );
-}
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) : RObject() {
-	setSEXP( pairlist(t1,t2,t3,t4,t5) );
-}
+/* <code-bloat> 
+
+	template <TYPENAMES>
+	DottedPair( ARGUMENTS ){
+		setSEXP( pairlist( PARAMETERS ) ) ;
+	}
+
+*/
+	template <typename T1>
+	DottedPair( const T1& t1 ){
+		setSEXP( pairlist( t1 ) ) ;
+	}
+
+	template <typename T1, typename T2>
+	DottedPair( const T1& t1, const T2& t2 ){
+		setSEXP( pairlist( t1, t2 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3 ){
+		setSEXP( pairlist( t1, t2, t3 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4 ){
+		setSEXP( pairlist( t1, t2, t3, t4 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19 ) ) ;
+	}
+
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20>
+	DottedPair( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19, const T20& t20 ){
+		setSEXP( pairlist( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20 ) ) ;
+	}
+
 /* </code-bloat> */
 #endif	
 

Modified: pkg/Rcpp/src/Rcpp/Function.h
===================================================================
--- pkg/Rcpp/src/Rcpp/Function.h	2010-03-15 13:07:03 UTC (rev 901)
+++ pkg/Rcpp/src/Rcpp/Function.h	2010-03-15 17:57:31 UTC (rev 902)
@@ -97,27 +97,117 @@
 		return internal::try_catch( Rf_lcons( m_sexp, pairlist(args...) ) ) ;
 	}
 #else
-/* <code-bloat> */
-template <typename T1>
-SEXP operator()( const T1& t1){
-	return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1) ) ) ;
-}
-template <typename T1, typename T2>
-SEXP operator()( const T1& t1, const T2& t2){
-	return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1,t2) ) ) ;
-}
-template <typename T1, typename T2, typename T3>
-SEXP operator()( const T1& t1, const T2& t2, const T3& t3){
+	SEXP operator()(){
+		return internal::try_catch( Rf_lcons( m_sexp, R_NilValue ) ) ;	
+	}
+/* <code-bloat>
+
+	template <TYPENAMES>
+	SEXP operator()(ARGUMENTS){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(PARAMETERS) ) ) ;
+	}
+	
+*/
+	template <typename T1>
+	SEXP operator()(const T1& t1){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1) ) ) ;
+	}
+	
+	template <typename T1, typename T2>
+	SEXP operator()(const T1& t1, const T2& t2){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3){
 		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3) ) ) ;
-}
-template <typename T1, typename T2, typename T3, typename T4>
-SEXP operator()( const T1& t1, const T2& t2, const T3& t3, const T4& t4){
-		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1,t2,t3,t4) ) ) ;
-}
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-SEXP operator()( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5){
-		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1,t2,t3,t4,t5) ) ) ;
-}
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19) ) ) ;
+	}
+	
+	template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20>
+	SEXP operator()(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19, const T20& t20){
+		return internal::try_catch( Rf_lcons( m_sexp, pairlist(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20) ) ) ;
+	}
+	
 /* </code-bloat> */
 #endif
 	

Modified: pkg/Rcpp/src/Rcpp/Language.h
===================================================================
--- pkg/Rcpp/src/Rcpp/Language.h	2010-03-15 13:07:03 UTC (rev 901)
+++ pkg/Rcpp/src/Rcpp/Language.h	2010-03-15 17:57:31 UTC (rev 902)
@@ -107,31 +107,219 @@
 	update() ;
 }
 #else
-/* <code-bloat> */
-template <typename T1> 
-Language( const std::string& symbol, const T1& t1) : DottedPair(Rf_install(symbol.c_str()), t1) { update() ; } 
+/* <code-bloat>
 
-template <typename T1, typename T2>
-Language( const std::string& symbol, const T1& t1, const T2& t2) : DottedPair(Rf_install(symbol.c_str()), t1,t2){ update() ; }
-
-template <typename T1, typename T2, typename T3>
-Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3): DottedPair(Rf_install(symbol.c_str()), t1,t2,t3) { update() ; }
-
-template <typename T1, typename T2, typename T3, typename T4>
-Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4): DottedPair(Rf_install(symbol.c_str()), t1,t2,t3,t4){ update() ;}
-
-
+template <TYPENAMES> 
+Language( const std::string& symbol, ARGUMENTS) : DottedPair(Rf_install(symbol.c_str()), PARAMETERS) { 
+	update() ;
+} 
+	
+template <TYPENAMES> 
+Language( const Function& function, ARGUMENTS) : DottedPair(function, PARAMETERS) { 
+	update() ;
+} 
+			
+*/
 template <typename T1> 
-Language( const Function& function, const T1& t1) : DottedPair(function, t1) { update() ;} 
-
-template <typename T1, typename T2>
-Language( const Function& function, const T1& t1, const T2& t2) : DottedPair(function, t1,t2){update() ;}
-
-template <typename T1, typename T2, typename T3>
-Language( const Function& function, const T1& t1, const T2& t2, const T3& t3): DottedPair(function, t1,t2,t3) {update() ;}
-
-template <typename T1, typename T2, typename T3, typename T4>
-Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4): DottedPair(function, t1,t2,t3,t4){ update() ;}
+Language( const std::string& symbol, const T1& t1) : DottedPair(Rf_install(symbol.c_str()), t1) { 
+	update() ;
+} 
+	
+template <typename T1> 
+Language( const Function& function, const T1& t1) : DottedPair(function, t1) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2> 
+Language( const std::string& symbol, const T1& t1, const T2& t2) : DottedPair(Rf_install(symbol.c_str()), t1, t2) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2> 
+Language( const Function& function, const T1& t1, const T2& t2) : DottedPair(function, t1, t2) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3) : DottedPair(function, t1, t2, t3) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4) : DottedPair(function, t1, t2, t3, t4) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) : DottedPair(function, t1, t2, t3, t4, t5) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5, t6) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) : DottedPair(function, t1, t2, t3, t4, t5, t6) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5, t6, t7) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7) : DottedPair(function, t1, t2, t3, t4, t5, t6, t7) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5, t6, t7, t8) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8) : DottedPair(function, t1, t2, t3, t4, t5, t6, t7, t8) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5, t6, t7, t8, t9) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9) : DottedPair(function, t1, t2, t3, t4, t5, t6, t7, t8, t9) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10) : DottedPair(function, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11) : DottedPair(function, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) { 
+	update() ;
+} 
+			
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> 
+Language( const std::string& symbol, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12) : DottedPair(Rf_install(symbol.c_str()), t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) { 
+	update() ;
+} 
+	
+template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12> 
+Language( const Function& function, const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12) : DottedPair(function, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) { 
+	update() ;
+} 
+			
[TRUNCATED]

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


More information about the Rcpp-commits mailing list