[Rprotobuf-commits] r412 - in pkg: . R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 12 14:23:07 CET 2011
Author: edd
Date: 2011-01-12 14:23:07 +0100 (Wed, 12 Jan 2011)
New Revision: 412
Modified:
pkg/ChangeLog
pkg/R/with.R
Log:
with thanks to Kurt: use eval() with envir=, not env=
Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog 2011-01-12 02:28:49 UTC (rev 411)
+++ pkg/ChangeLog 2011-01-12 13:23:07 UTC (rev 412)
@@ -1,3 +1,7 @@
+2011-01-12 Dirk Eddelbuettel <edd at debian.org>
+
+ * R/with.R: Use envir= argument to eval()
+
2011-01-11 Dirk Eddelbuettel <edd at debian.org>
* DESCRIPTION: Release 0.2.2
Modified: pkg/R/with.R
===================================================================
--- pkg/R/with.R 2011-01-12 02:28:49 UTC (rev 411)
+++ pkg/R/with.R 2011-01-12 13:23:07 UTC (rev 412)
@@ -3,8 +3,8 @@
generateActiveBindings <- function(data){
env <- new.env( parent = environment() )
xp <- data at pointer
- names <- .Call( "Message__fieldNames", xp, PACKAGE = "RProtoBuf" )
-
+ names <- .Call( "Message__fieldNames", xp, PACKAGE = "RProtoBuf" )
+
if( !is.null(names) && length(names) ){
lapply( names, function(x ){
makeActiveBinding( x, function(v){
@@ -22,13 +22,13 @@
}
with.Message <- function( data, expr, ...){
- env <- generateActiveBindings(data)
- eval( substitute( expr ), env = env )
+ envir <- generateActiveBindings(data)
+ eval( substitute( expr ), envir = envir )
}
within.Message <- function(data, expr, ... ){
- env <- generateActiveBindings(data)
- eval( substitute( expr ), env = env )
+ envir <- generateActiveBindings(data)
+ eval( substitute( expr ), envir = envir )
data
}
More information about the Rprotobuf-commits
mailing list