[Rcpp-commits] r2110 - pkg/Rcpp/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 15 11:46:51 CEST 2010


Author: romain
Date: 2010-09-15 11:46:51 +0200 (Wed, 15 Sep 2010)
New Revision: 2110

Modified:
   pkg/Rcpp/R/Module.R
Log:
trying to use a named empty list, but refClassInheritance wipes it anyway

Modified: pkg/Rcpp/R/Module.R
===================================================================
--- pkg/Rcpp/R/Module.R	2010-09-15 08:45:09 UTC (rev 2109)
+++ pkg/Rcpp/R/Module.R	2010-09-15 09:46:51 UTC (rev 2110)
@@ -258,16 +258,17 @@
 			    }
 			    fieldPrototypes[[ f ]] <- new( fieldClasses[[ f ]] )
 			}
+			dummy <- list() ; names(dummy) <- character(0)
 			setRefClass( clname, 
-			    fieldClasses = fieldClasses,
-			    fieldPrototypes = fieldPrototypes , 
+			    # fieldClasses = fieldClasses,
+			    fieldPrototypes = dummy , 
 			    contains = "C++Object", 
 			    interfaceClasses = classRep, 
 			    where = where
 			)
 			
 			imethods <- referenceMethods( classRep )
-				
+				  
 			initializer <- function(.Object, ...){
 				.Object <- callNextMethod()
 				
@@ -276,7 +277,7 @@
 				assign( ".self", .Object, envir = selfEnv )
 				
 				# <hack>
-				rm( list = names(fieldClasses), envir = selfEnv )
+				try( rm( list = names(fieldClasses), envir = selfEnv ), silent = TRUE )
 				for( prop in names(fieldClasses) ){
 				    caps <- methods:::firstCap( prop )
 				    binding_fun <- function(x){



More information about the Rcpp-commits mailing list