[Rd] R_ReplDLLdo1 and task callbacks

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Sat Jun 5 14:27:19 CEST 2010


Dear R developers,

in RKWard we use a custom main loop built around R_ReplDLLdo1(). Recently I 
found out that toplevel task callback are not called. Looking at the source of 
R_ReplDLLdo1() in main.c, the reason is easy to see: This simply does not 
include a call to Rf_callToplevelHandlers().

There may well be reasons for that. On the other hand, I could not find 
explicit documentation to this effect, and according to svn annotate, 
R_ReplDLLdo1() predates task callbacks. So perhaps this is an oversight after 
all. Using the google code search, the only other use case I could find 
(besides R test cases, and RKWard) is the Mac-GUI. I would assume that calling 
the task callback handlers would be the desired behavior, there, too.

I did not find any way to integrate the task callback handlers from the 
embedding application, when using R_ReplDLLdo1(). Is there any? Would it be 
possible to add a call to Rf_callToplevelHandlers in R_ReplDLLdo1() (*)? 
Alternatively, would it be possible to add an equivalent of
  R_ReplConsole(R_GlobalEnv, R_PPStackTop, 0);
to the API (importantly without calls to setup_Rmainloop() and 
end_Rmainloop())?

Thanks,
Thomas

--

(*): In fact, I wonder, why R_ReplDLLdo1() is not simply based on 
Rf_ReplIteration().
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20100605/ffab335d/attachment.bin>


More information about the R-devel mailing list