From ebo at sandien.com  Wed Sep  3 17:15:41 2008
From: ebo at sandien.com (EBo)
Date: Wed, 3 Sep 2008 09:15:41 MDT
Subject: [Rd] suggestion of new API function for embedded programming.
In-Reply-To: <alpine.LFD.1.10.0809030920560.28931@nokomis.stat.uiowa.edu>
References: <twig.1220449912.10283@swcp.com>, <twig.1220449912.10283@swcp.com>
Message-ID: <twig.1220454941.83227@swcp.com>

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



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