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

Brian,

Prof Brian Ripley <mailto:ripley at stats.ox.ac.uk> 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 is a vector here?  Something which gets actually allocated by
> allocVector() AFAICS, that is an atomic or generic vector or an
> expression.  OTOH, an EXTPTRSXP is stored in a cons cell.
> 
> There is also a function length(), which is safer.

Thanks for your message. Things are much clearer now to me.

Can I safely assume that INTSXP, REALSXP, LGLSXP, STRSXP, CPLXSXP and VECSXP
are
vectors (while EXTPTRSXP is not).

Thomas



[Rd] R_MakeExternalPtr
TB