[Rd] asking for advice on how to catch nonexistent list elements

2007-02-27 Thread Tamas K Papp
Hi, I am sorry if this is documented or in the archives somewhere, I tried searching and could not find anything. When using the $ operator to get a nonexistent element (or if you prefer, all elements are defined as NULL by default) of a list, it returns NULL, eg > a <- list(maximum=12) > a$maxi

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Luke Tierney
On Tue, 27 Feb 2007, Ernest Turro wrote: > > On 27 Feb 2007, at 17:45, Luke Tierney wrote: > >> On Tue, 27 Feb 2007, Ernest Turro wrote: >> >>> Hi Ross, >>> >>> On 26 Feb 2007, at 22:34, Ross Boylan wrote: >>> On Mon, 2007-02-26 at 16:08 +, Ernest Turro wrote: > Thanks for your com

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Ernest Turro
On 27 Feb 2007, at 17:45, Luke Tierney wrote: > On Tue, 27 Feb 2007, Ernest Turro wrote: > >> Hi Ross, >> >> On 26 Feb 2007, at 22:34, Ross Boylan wrote: >> >>> On Mon, 2007-02-26 at 16:08 +, Ernest Turro wrote: Thanks for your comments Ross. A couple more comments/queries below:

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Luke Tierney
On Tue, 27 Feb 2007, Ernest Turro wrote: > Hi Ross, > > On 26 Feb 2007, at 22:34, Ross Boylan wrote: > >> On Mon, 2007-02-26 at 16:08 +, Ernest Turro wrote: >>> Thanks for your comments Ross. A couple more comments/queries below: >>> >>> On 26 Feb 2007, at 06:43, Ross Boylan wrote: >>> [d

Re: [Rd] Checking for user interrupt in a .C() call without without triggering a non-local exit.

2007-02-27 Thread Luke Tierney
On Mon, 26 Feb 2007, Pavel N. Krivitsky wrote: > Hi, > > An R package on which I am working makes a series of very > computationally-intensive and complex .C() calls, that I would like to > make interruptible. However, calling R_CheckUserInterrupt() causes a > non-local exit, so the memory allocat

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Ernest Turro
[snip] Sorry. Small mistake fixed below: > > Leaving aside the HAVE_AQUA and Win32 cases, I would like to write > a new function: > > int R_CheckInterruptsPending(void) > { > R_CheckStack(); > return R_interrupts_pending; > } > > and then in my C++ code: > if(R_CheckInterruptsPending)

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Ernest Turro
Hi Ross, On 26 Feb 2007, at 22:34, Ross Boylan wrote: > On Mon, 2007-02-26 at 16:08 +, Ernest Turro wrote: >> Thanks for your comments Ross. A couple more comments/queries below: >> >> On 26 Feb 2007, at 06:43, Ross Boylan wrote: >> >>> [details snipped] >>> >>> The use of the R api can be co