[Rd] suggestion of new API function for embedded programming.

EBo ebo at sandien.com
Wed Sep 3 17:15:41 CEST 2008


Luke Tierney <luke at stat.uiowa.edu> said:

> ...
> > do something like the following:
> >
> >  R_Expr = R_Parse1Buffer(&R_ConsoleIob, 0, &status);
> >  if (PARSE_OK==status) {
> >    ...
> >    value = eval(R_CurrentExpr, rho);
> >    ...
> >  }
> 
> We definitely do NOT want this frozen into the public API.

What is your objection with making something like this a part of the public
API?  I understand that having to use the IOBuffer seems a bit much, but I do
not understand your concern.

> > or possibly simplifying the interface to take the CMDL string:
> >
> >  R_Expr = R_Parse1Line("t.test(x,conf.level=(1-p))$conf.int[2]", &status);
> 
> Something along these lines should be feasible in principle, though
> care may be needed in handlign of errors.

Agreed.  I would also add that R_Parse1Line should also not modify any global
variables so that it basicall functions independently and does not violate the
law of least surprise.  This imples that an environment would also be passed in:

  R_Expr=R_Parse1Line("t.test(x,conf.level=(1-p))$conf.int[2]", rho, &status);

  Thanks and best regards,

  EBo --



More information about the R-devel mailing list