[rkward-cvs] SF.net SVN: rkward:[2556] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Jun 30 11:22:33 UTC 2009
Revision: 2556
http://rkward.svn.sourceforge.net/rkward/?rev=2556&view=rev
Author: tfry
Date: 2009-06-30 11:22:33 +0000 (Tue, 30 Jun 2009)
Log Message:
-----------
Make sure to once again put back any promises that we forced in .GlobalEnv
Modified Paths:
--------------
trunk/rkward/TODO
trunk/rkward/rkward/core/robject.cpp
trunk/rkward/rkward/rbackend/rembedinternal.cpp
trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R
Modified: trunk/rkward/TODO
===================================================================
--- trunk/rkward/TODO 2009-06-26 15:13:01 UTC (rev 2555)
+++ trunk/rkward/TODO 2009-06-30 11:22:33 UTC (rev 2556)
@@ -201,6 +201,8 @@
- When saving workplace layout, save it relative to the workspace file. Allows to move the workspace, easier
- KURL::relativeUrl()
- How to deal with workplaces saved in the config (and not bound to a workspace file?)
+ - all RKComponents:
+ - in the documentation we call the return value of value() the "default property". Why not simply define a "default property" for each component, instead of reimplementing value()?
General code:
- use constBegin (), constEnd ()
Modified: trunk/rkward/rkward/core/robject.cpp
===================================================================
--- trunk/rkward/rkward/core/robject.cpp 2009-06-26 15:13:01 UTC (rev 2555)
+++ trunk/rkward/rkward/core/robject.cpp 2009-06-30 11:22:33 UTC (rev 2556)
@@ -250,7 +250,16 @@
void RObject::updateFromR (RCommandChain *chain) {
RK_TRACE (OBJECTS);
- RCommand *command = new RCommand (".rk.get.structure (" + getFullName () + ", " + rQuote (getShortName ()) + ')', RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
+ RCommand *command;
+ if (getContainer () == RObjectList::getGlobalEnv ()) {
+#warning TODO: find a generic solution
+// We handle objects directly in .GlobalEnv differently. That's to avoid forcing promises, when addressing the object directly. In the long run, .rk.get.structure should be reworked to simply not need the value-argument in any case.
+ command = new RCommand (".rk.get.structure.global (" + rQuote (getShortName ()) + ')', RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
+ } else {
+ RK_ASSERT (false); // non-catastrophic, but do we get here?
+
+ command = new RCommand (".rk.get.structure (" + getFullName () + ", " + rQuote (getShortName ()) + ')', RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
+ }
RKGlobals::rInterface ()->issueCommand (command, chain);
}
Modified: trunk/rkward/rkward/rbackend/rembedinternal.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rembedinternal.cpp 2009-06-26 15:13:01 UTC (rev 2555)
+++ trunk/rkward/rkward/rbackend/rembedinternal.cpp 2009-06-30 11:22:33 UTC (rev 2556)
@@ -720,6 +720,12 @@
return R_MakeExternalPtr (ret, RKWard_RData_Tag, R_NilValue);
}
+SEXP doGetGlobalEnvStructure (SEXP name, SEXP envlevel, SEXP namespacename) {
+ RK_TRACE (RBACKEND);
+
+ return doGetStructure (findVar (Rf_install (CHAR (STRING_ELT (name, 0))), R_GlobalEnv), name, envlevel, namespacename);
+}
+
/** copy a symbol without touching it (esp. not forcing any promises) */
SEXP doCopyNoEval (SEXP name, SEXP fromenv, SEXP toenv) {
RK_TRACE (RBACKEND);
@@ -799,6 +805,7 @@
{ "rk.do.command", (DL_FUNC) &doSubstackCall, 1 },
{ "rk.update.locale", (DL_FUNC) &doUpdateLocale, 0 },
{ "rk.get.structure", (DL_FUNC) &doGetStructure, 4 },
+ { "rk.get.structure.global", (DL_FUNC) &doGetGlobalEnvStructure, 3 },
{ "rk.copy.no.eval", (DL_FUNC) &doCopyNoEval, 3 },
{ "rk.edit.files", (DL_FUNC) &doEditFiles, 3 },
{ "rk.show.files", (DL_FUNC) &doShowFiles, 4 },
Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R 2009-06-26 15:13:01 UTC (rev 2555)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R 2009-06-30 11:22:33 UTC (rev 2556)
@@ -290,6 +290,10 @@
".rk.get.structure" <- .rk.get.structure.new
+".rk.get.structure.global" <- function (name, envlevel=0, namespacename=NULL) {
+ .Call ("rk.get.structure.global", as.character (name), as.integer (envlevel), namespacename)
+}
+
".rk.get.formals" <- function (x)
{
f <- formals (x)
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