[rkward-tracker] [ rkward-Bugs-1788228 ] rkward mishandles promises inside globalenv()

SourceForge.net noreply at sourceforge.net
Wed Sep 5 09:39:24 UTC 2007


Bugs item #1788228, was opened at 2007-09-05 07:25
Message generated for change (Comment added) made by tfry
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=459007&aid=1788228&group_id=50231

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: data handling
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
>Summary: rkward mishandles promises inside globalenv()

Initial Comment:
To replicate this problem (using the versions of R and rkward in Debian unstable as of September 5, 2007), see the example for help(delayedAssign) . Specifically, doing the following in a plain R session

msg <- "old"
delayedAssign("x", msg)
msg <- "new!"
x

correctly outputs the word "new!" in the console. However, doing the same in rkward produces the word "old". 

Although many people do not use functions like delayedAssign(), this bug could potentially cause them to get the wrong results without them knowing.

Thanks,
Ben Goodrich

----------------------------------------------------------------------

>Comment By: Thomas Friedrichsmeier (tfry)
Date: 2007-09-05 11:39

Message:
Logged In: YES 
user_id=300591
Originator: NO

Confirmed. However, this only happens inside globalenv(). The problem is
that we copy symbols in globalenv() to a special environment
(.rk.watched.symbols), and replace them with an active binding. This is
used so we can detect, when something new gets assigned to the original
symbol. However, an unwanted side-effect is that the promise will be forced
at this point of time.

I suppose the only way around this would be to replace .rk.watch.symbol
with a function implemented in C, which makes sure to copy the promise
without forcing it (or is there a way to do this in R code?).

Note that this has nothing to do with retrieving structure information
(for the workspace browser) for the object (which I suspected first). The
code we have for that already makes sure to look at promises without
actually forcing them.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=459007&aid=1788228&group_id=50231




More information about the rkward-tracker mailing list