Bug 380693 - rkward mishandles promises inside globalenv()
Summary: rkward mishandles promises inside globalenv()
Status: RESOLVED FIXED
Alias: None
Product: rkward
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR normal
Target Milestone: ---
Assignee: RKWard Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-05 04:25 UTC by RKWard Team
Modified: 2007-09-20 17:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RKWard Team 2007-09-05 04:25:14 UTC
-- Originally posted by (AT sourceforge.net): *anonymous --

-- This ticket was imported from http://sourceforge.net/p/rkward/bugs/20 on 2017-05-30 15:26:40 +0100 --
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-- Labels: data handling --
Comment 1 Thomas Friedrichsmeier 2007-09-05 08:39:23 UTC
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.
Comment 2 Thomas Friedrichsmeier 2007-09-05 08:39:23 UTC
- **summary**: rkward mishandles promises --> rkward mishandles promises inside globalenv()
Comment 3 Thomas Friedrichsmeier 2007-09-20 17:59:29 UTC
Logged In: YES 
user\_id=300591
Originator: NO

Fixed in SVN revision 1979, to be included in the 0.4.8 release.
Comment 4 Thomas Friedrichsmeier 2007-09-20 17:59:29 UTC
- **assigned_to**: nobody --> tfry
- **status**: open --> closed-fixed