From radford at cs.toronto.edu  Sat May 11 17:27:21 2013
From: radford at cs.toronto.edu (Radford Neal)
Date: Sat, 11 May 2013 11:27:21 -0400
Subject: [Rd] call R function from C code
Message-ID: <20130511152721.GA23097@cs.toronto.edu>

> From: "Matwey V. Kornilov" <matwey.kornilov at gmail.com>
>
> the following seems to work just great for me:
>
> PROTECT(sx = eval(lang3(install("solve"),sA,sb),R_BaseEnv))

You need to PROTECT the result of lang3 before calling eval.
And on the other hand, you don't necessarily have to protect
the result of eval (only if you will be doing further allocations
while still using sx).

   Radford Neal



[Rd] call R function from C code
Radford Neal