[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-devel
Subject:    [Rd] Wish: C-API to print if R_Visible is TRUE (PR#9467)
From:       thomas.friedrichsmeier () ruhr-uni-bochum ! de
Date:       2007-01-25 16:26:39
Message-ID: 20070125162639.6F59B4C912 () slim ! kubism ! ku ! dk
[Download RAW message or body]

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


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;
}

Regards
Thomas Friedrichsmeier

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic