[Rd] C-API: check whether R has been initialized ?

2015-05-03 Thread Laurent Gautier
Hi, There appear to be no way to check whether R has already been initialized. Could a function like "Rf_isinitialized" be added to the API ? Best, Laurent [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://

Re: [Rd] C-API: check whether R has been initialized ?

2015-05-03 Thread Duncan Murdoch
On 03/05/2015 4:34 PM, Laurent Gautier wrote: > Hi, > > There appear to be no way to check whether R has already been initialized. > > Could a function like "Rf_isinitialized" be added to the API ? > Surely any program that needs to know that could keep its own flag. You'll need to give a much

Re: [Rd] C-API: check whether R has been initialized ?

2015-05-03 Thread Laurent Gautier
Beside the possible argumentation that with an API elegance and convenience might sometimes be superior to necessity, the suggested pattern ("every program, including R itself, keeping its own flag") does no work too well when the nested embedding of R is involved. A concrete example is: ``` $ R -

Re: [Rd] C-API: check whether R has been initialized ?

2015-05-03 Thread Duncan Murdoch
On 03/05/2015 7:02 PM, Laurent Gautier wrote: > Beside the possible argumentation that with an API elegance and > convenience might sometimes be superior to necessity, the suggested > pattern ("every program, including R itself, keeping its own flag") does > no work too well when the nested embeddi

Re: [Rd] C-API: check whether R has been initialized ?

2015-05-03 Thread Laurent Gautier
rPython appears to provide an interface from R to Python by embedding Python and I'd think that it can safely assume that R has been initialized, but might not be the point here. The issue is that a Python package embedding itself R (here rpy2) appears to have no way to know that earlier in the li

Re: [Rd] C-API: check whether R has been initialized ?

2015-05-03 Thread Simon Urbanek
Laurent, On May 3, 2015, at 8:07 PM, Laurent Gautier wrote: > rPython appears to provide an interface from R to Python by embedding > Python and I'd think that it can safely assume that R has been initialized, > but might not be the point here. > > The issue is that a Python package embedding i