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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 5 12:54:02 CEST 2011


Author: romain
Date: 2011-04-05 12:54:02 +0200 (Tue, 05 Apr 2011)
New Revision: 2953

Modified:
   pkg/Rcpp/R/01_show.R
Log:
explicitely state that no method is exposed

Modified: pkg/Rcpp/R/01_show.R
===================================================================
--- pkg/Rcpp/R/01_show.R	2011-04-05 10:52:01 UTC (rev 2952)
+++ pkg/Rcpp/R/01_show.R	2011-04-05 10:54:02 UTC (rev 2953)
@@ -74,14 +74,18 @@
 	    writeLines( "\nFields: No public fields exposed by this class" )
 	}
 	
-	writeLines( "\nMethods: " )
 	mets <- object at methods
 	nmethods <- length(mets)
-	txt <- character( nmethods )
-	for( i in seq_len(nmethods) ){
-	    txt[i] <- mets[[i]]$info("    ")
+	if( nmethods ){
+	    writeLines( "\nMethods: " )
+	    txt <- character( nmethods )
+	    for( i in seq_len(nmethods) ){
+	        txt[i] <- mets[[i]]$info("    ")
+	    }
+	    writeLines( paste( txt, collapse = "\n" ) ) 
+	} else {
+	    writeLines( "\nMethods: no methods exposed by this class" )
 	}
-	writeLines( paste( txt, collapse = "\n" ) )
 } )
 
 setMethod( "show", "C++Function", function(object){



More information about the Rcpp-commits mailing list