From thomas.baier at kirchnersoft.com  Mon Oct 24 10:12:30 2005
From: thomas.baier at kirchnersoft.com (TB)
Date: Mon, 24 Oct 2005 10:12:30 +0200
Subject: [Rd] R_MakeExternalPtr
Message-ID: <F05B338A1B21D9119FFF0004761A511301ECD6@MXS>

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 an "unitialized" value.

Can I safely assume, that an SEXP of type EXTPTRSXP can only contain a
single pointer value and never represent a vector (an array) of pointers? Or
should I maybe explicitly add something like

	SETLENGTH(sexp,1);

Best wishes from sunny Austria,

Thomas Baier



[Rd] R_MakeExternalPtr
TB