[Rcpp-commits] r3652 - in pkg/RcppBDT: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 30 17:58:53 CEST 2012


Author: edd
Date: 2012-06-30 17:58:53 +0200 (Sat, 30 Jun 2012)
New Revision: 3652

Modified:
   pkg/RcppBDT/ChangeLog
   pkg/RcppBDT/DESCRIPTION
   pkg/RcppBDT/R/zzz.R
Log:
updated for R 2.15.1 with new loading mechanism
fixed typos in DESCRIPTION and ChangeLog too


Modified: pkg/RcppBDT/ChangeLog
===================================================================
--- pkg/RcppBDT/ChangeLog	2012-06-30 01:51:46 UTC (rev 3651)
+++ pkg/RcppBDT/ChangeLog	2012-06-30 15:58:53 UTC (rev 3652)
@@ -1,7 +1,11 @@
+2012-06-30  Dirk Eddelbuettel  <edd at debian.org>
+
+	* R/zzz.R: Updated for R 2.15.1 using loadModule() and evalqOnLoad()
+
 2012-04-11  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/include/RcppBDT.h, src/RcppBDT.cpp: prefix local #define
-	variable with RcppBDT_ to avoid any possivke clashes
+	variable with RcppBDT_ to avoid any possible clashes
 
 	* inst/include/RcppBDT.h, src/RcppBDT.cpp: remove exception
 	specifications in partial specializations for as and wrap

Modified: pkg/RcppBDT/DESCRIPTION
===================================================================
--- pkg/RcppBDT/DESCRIPTION	2012-06-30 01:51:46 UTC (rev 3651)
+++ pkg/RcppBDT/DESCRIPTION	2012-06-30 15:58:53 UTC (rev 3652)
@@ -1,7 +1,7 @@
 Package: RcppBDT
 Type: Package
 Title: Rcpp bindings for the Boost Date_Time library 
-Version: 0.1.0.1
+Version: 0.1.0.2
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois
 Maintainer: Dirk Eddelbuettel <edd at debian.org>
@@ -10,8 +10,8 @@
  .
  Currently only Date functionality is covered.
  .
- Boost header files are needed to build the package. Linking is optional and
- provides supplementary date to/from strings conversion functions.
+ Boost header files are needed to build the package. Linking is optional to
+ provide supplementary date to/from strings conversion functions. 
 License: GPL (>= 2)
 LazyLoad: yes
 Depends: Rcpp (>= 0.9.0), methods

Modified: pkg/RcppBDT/R/zzz.R
===================================================================
--- pkg/RcppBDT/R/zzz.R	2012-06-30 01:51:46 UTC (rev 3651)
+++ pkg/RcppBDT/R/zzz.R	2012-06-30 15:58:53 UTC (rev 3652)
@@ -19,25 +19,33 @@
 ## along with RcppBDT.  If not, see <http://www.gnu.org/licenses/>.
 
 
+## .onLoad <- function (lib, pkg) {
+##     req <- get(paste("req", "uire", sep=""))	# we already Imports: methods, but there may
+##     req("methods")  	        		# be a race condition lurking
+##     loadRcppModules(direct=FALSE)
+
+##     setMethod("show", "Rcpp_date", .show_date)
+##     setGeneric("format", function(x,...) standardGeneric("format") )
+##     setMethod("format", "Rcpp_date", .format_date )
+## }
+
+
+loadModule("bdtMod", TRUE)
+
+## create a variable 'bdt' from out bdtMod Module
+## this variable is used as a package-global instance
 delayedAssign( "bdt", local( {
-    x <- new( bdtMod$date )
+    x <- new( date )
     x$setFromUTC()
     x
 }) )
 
-
 .format_date <- function(x, ...) format(x$getDate(), ...)
 .show_date <- function(object) print(object$getDate())
 
-.onLoad <- function (lib, pkg) {
-    req <- get(paste("req", "uire", sep=""))	# we already Imports: methods, but there may
-    req("methods")  	        		# be a race condition lurking
-    loadRcppModules(direct=FALSE)
-
+## define an onLoad expression to set some methods
+evalqOnLoad({
     setMethod("show", "Rcpp_date", .show_date)
     setGeneric("format", function(x,...) standardGeneric("format") )
     setMethod("format", "Rcpp_date", .format_date )
-
-}
-
-
+})



More information about the Rcpp-commits mailing list