From ebo at sandien.com  Wed Sep  3 15:51:52 2008
From: ebo at sandien.com (EBo)
Date: Wed, 3 Sep 2008 07:51:52 MDT
Subject: [Rd] suggestion of new API function for embedded programming.
Message-ID: <twig.1220449912.10283@swcp.com>


While doing some embedded programming and trying to figure out how to generate
a hand coded SEXP equivalent of the line
"t.test(x,conf.level=(1-p))$conf.int[2]" I had an idea for an addition to the
embedded API.

There are a number of hidden or static parse functions (R_ParseBuffer,
R_Parse1Buffer, etc.) which take an IoBuffer* and returns a parsed tree.  If
one or more of these functions were exported to the Rembedded.h API we could
do something like the following:

  R_Expr = R_Parse1Buffer(&R_ConsoleIob, 0, &status);
  if (PARSE_OK==status) {
    ...
    value = eval(R_CurrentExpr, rho);
    ...
  }

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

I think this would be a useful addition to the embedding interface, and
hopefully not difficult to incorporate by someone more experienced with the
internals than I currently am.  I took a few hours to look into adding this
interface, but will not have time to try to do so for a few months -- I have a
couple of hard and fast deadlines over the next couple of weeks.  So, I would
like to make the suggestion and participate in the dialog.

  Best regards,

  EBo --

ps: if someone can suggest how to hand code
"t.test(x,conf.level=(1-p))$conf.int[2]" so I can embedd it I would be most
appreciative.



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