From byron.ellis at gmail.com  Sat Apr  7 01:23:07 2007
From: byron.ellis at gmail.com (Byron Ellis)
Date: Fri, 6 Apr 2007 16:23:07 -0700
Subject: [Rd] wishlist: additional argument in R_tryEval (Rinternals.h)
In-Reply-To: <Pine.LNX.4.64.0704061726440.3661@itasca2.wildberry.org>
References: <eb555e660704061500o58da8b60ya109a17f239fb64c@mail.gmail.com>
	<Pine.LNX.4.64.0704061726440.3661@itasca2.wildberry.org>
Message-ID: <7098abec0704061623h207e60c8v247aced20e24c416@mail.gmail.com>

It's come up for me when I do FFI stuff. For GUI stuff I usually just
want to suppress, but it's possible that you'd want to detect
visibility if you were to make the GUI more programmable. I usually
end up having to work around the whole business by fiddling with
R_Visible.

Speaking of R_tryEval, can someone with the appropriate powers PRETTY
PLEASE just make it an official API? Having it continue to be
unofficial is just getting silly.


On 4/6/07, Luke Tierney <luke at stat.uiowa.edu> wrote:
> Even though it isn't officially part of the API it has seen some use
> so I'd prefer not to change the interface; instead add
>
> SEXP R_tryEvalWithVis(SEXP e, SEXP env, int *ErrorOccurred, int *visible);
>
> or something along those lines and define R_tryEval internally in
> terms of that.
>
> It may be worth thinking a bit more though to see if there is
> something else that might be useful at this point.  I vaguely recall
> thinking recently about needing something else of this flavor but I
> can't seem to remember what it was exactly -- will try to see if I can
> recall.
>
> Best,
>
> luke
>
>
> On Fri, 6 Apr 2007, Deepayan Sarkar wrote:
>
> > Hi,
> >
> > R_tryEval, exported in Rinternals.h but not part of the API, is
> > currently defined as:
> >
> > R_tryEval(SEXP e, SEXP env, int *ErrorOccurred);
> >
> > I'm trying to embed R in an application (basically yet another GUI),
> > and this has been very helpful to catch errors. It would be even more
> > helpful if it also gave access to the visibility flag. I can wrap this
> > in a call to withVisible, and that works great, but if there is an
> > error, traceback() contains a bunch of irrelevant levels.
> >
> > It seems fairly easy to add another argument, similar to
> > ErrorOccurred, that is set to the visibility flag before returning. Is
> > this something that could be considered for addition in R-devel? A
> > possible patch for R/trunk is attached. Mac-GUI/REngine/REngine.m will
> > also need a patch, but I don't understand the language it's written
> > in.
> >
> > -Deepayan
> >
>
> --
> Luke Tierney
> Chair, Statistics and Actuarial Science
> Ralph E. Wareham Professor of Mathematical Sciences
> University of Iowa                  Phone:             319-335-3386
> Department of Statistics and        Fax:               319-335-3017
>     Actuarial Science
> 241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


-- 
Byron Ellis (byron.ellis at gmail.com)
"Oook" -- The Librarian



[Rd] wishlist: additional argument in R_tryEval (Rinternals.h)
Byron Ellis