Re: [Rd] R_MakeExternalPtr 'tag' argument

2015-11-14 Thread Simon Urbanek
On Nov 13, 2015, at 3:58 PM, William Dunlap wrote: > Most packages that use the R_MakeExternalPtr function use > Rf_install("pkgSpecificString") for its 'tag' argument (if they don't use > R_NilValue). A few use Rf_mkChar("pkgSpecificString"). > > Is there any reason to prefer one over the oth

[Rd] R_MakeExternalPtr 'tag' argument

2015-11-13 Thread William Dunlap
Most packages that use the R_MakeExternalPtr function use Rf_install("pkgSpecificString") for its 'tag' argument (if they don't use R_NilValue). A few use Rf_mkChar("pkgSpecificString"). Is there any reason to prefer one over the other? Bill Dunlap TIBCO Software wdunlap tibco.com _

Re: [Rd] R_MakeExternalPtr

2005-10-24 Thread Prof Brian Ripley
On Mon, 24 Oct 2005, TB wrote: > Brian, > > Prof Brian Ripley wrote: >> This is one of those undocumented things (AFAIK): LENGTH applies only >> to 'vectors'. So don't use t and definitely don't set it for others. >> The macro expands to >> >> #define LENGTH(x) ((

Re: [Rd] R_MakeExternalPtr

2005-10-24 Thread TB
Brian, Prof Brian Ripley wrote: > This is one of those undocumented things (AFAIK): LENGTH applies only > to 'vectors'. So don't use t and definitely don't set it for others. > The macro expands to > > #define LENGTH(x) (((VECSEXP) (x))->vecsxp.length) > > What

Re: [Rd] R_MakeExternalPtr

2005-10-24 Thread Prof Brian Ripley
This is one of those undocumented things (AFAIK): LENGTH applies only to 'vectors'. So don't use t and definitely don't set it for others. The macro expands to #define LENGTH(x) (((VECSEXP) (x))->vecsxp.length) What is a vector here? Something which gets actually allocated by allocVect

[Rd] R_MakeExternalPtr

2005-10-24 Thread TB
Hi, I'm using R_MakeExternalPtr() to store handles to (COM) objects in a SEXP. The code basically is sexp = R_MakeExternalPtr(handle,R_NilValue,R_NilValue); R_RegisterCFinalizerEx(...); After creating the sexp, LENGTH(sexp) returns some quite large integer value. It seems like a