[Rd] Wish: C-API to print if R_Visible is TRUE (PR#9467)

From: <thomas.friedrichsmeier_at_ruhr-uni-bochum.de>
Date: Thu 25 Jan 2007 - 16:26:39 GMT

Full_Name: Thomas Friedrichsmeier
Version: 2.4.1
OS: Linux
Submission from: (NULL) (

Frontends wishing to emulate an R console typically want to print the value of an evaluation, if and only if R_Visible is TRUE. R_Visible has never been part of the public API (at least not as far as I looked back). In current SVN it is also hidden from the library. The new R function withVisible() in current SVN addresses the same issue, but is not easily usable from C (for a more detailed discussion, see https://stat.ethz.ch/pipermail/r-devel/2007-January/044336.html).

Two alternative suggestions:
1) Make R_Visible part of the public API, or at least make it an exported symbol again (so the daring can declare it extern and link against it).

2) It might be both cleaner and more convenient for API users to add something like the following function, instead:
Rboolean Rf_doAutoPrint(SEXP exp, Rboolean forceprint) {

        if(R_Visible || forceprint) {
            printValueEnv(exp, R_GlobalEnv);
            return TRUE;                /* was printed */
        return FALSE;


Thomas Friedrichsmeier

R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Jan 26 03:29:39 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 25 Jan 2007 - 17:31:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.