[rkward-cvs] SF.net SVN: rkward:[3170] trunk/rkward/rkward/rbackend/rpackages/rkward/R/ internal.R

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Nov 2 09:11:13 UTC 2010


Revision: 3170
          http://rkward.svn.sourceforge.net/rkward/?rev=3170&view=rev
Author:   tfry
Date:     2010-11-02 09:11:13 +0000 (Tue, 02 Nov 2010)

Log Message:
-----------
Make a better effort to override makeActiveBinding()

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R	2010-11-01 16:34:29 UTC (rev 3169)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R	2010-11-02 09:11:13 UTC (rev 3170)
@@ -145,13 +145,14 @@
 ".rk.watched.symbols" <- new.env ()
 
 # override makeActiveBinding: If active bindings are created in globalenv (), watch them properly
+.rk.makeActiveBinding.default <- base::makeActiveBinding
 "makeActiveBinding" <- function (sym, fun, env, ...) {
 	if (identical (env, globalenv ())) {
-		base::makeActiveBinding (sym, fun, .rk.watched.symbols, ...)
+		.rk.makeActiveBinding.default (sym, fun, .rk.watched.symbols, ...)
 		f <- .rk.make.watch.f (sym)
-		base::makeActiveBinding (sym, f, globalenv (), ...)
+		.rk.makeActiveBinding.default (sym, f, globalenv (), ...)
 	} else {
-		base::makeActiveBinding (sym, fun, env, ...)
+		.rk.makeActiveBinding.default (sym, fun, env, ...)
 	}
 }
 
@@ -418,6 +419,10 @@
 ".rk.fix.assignments" <- function () {
 	assignInNamespace ("menu", menu, envir=as.environment ("package:utils"))
 	assignInNamespace ("select.list", select.list, envir=as.environment ("package:utils"))
+	try ({
+		unlockBinding ("makeActiveBinding", base::.BaseNamespaceEnv)
+		assign ("makeActiveBinding", rkward::makeActiveBinding, envir=base::.BaseNamespaceEnv)
+	})
 	
 	# call separate assignments functions:
 	if (exists (".rk.fix.assignments.graphics")) eval (body (.rk.fix.assignments.graphics)) # internal_graphics.R


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list