From khansen at stat.berkeley.edu  Sun Feb 15 00:39:45 2009
From: khansen at stat.berkeley.edu (Kasper Daniel Hansen)
Date: Sat, 14 Feb 2009 15:39:45 -0800
Subject: [Rd] SET_VECTOR_ELT and STRSXPs
Message-ID: <F270E6E2-47FE-41C9-8FED-49EBB6B70758@stat.berkeley.edu>

It seems (based on the NEWS file and on output from R CMD check) that  
we may no longer use SET_VECTOR_ELT on STRSXPs. So I guess that  
section 5.14 of R-extensions needs to be updated, the current phrasing  
is
"By default a certain amount of misuse is allowed where the internal  
representation is the same: for example LOGICAL can be used on a  
INTSXP and SET_VECTOR_ELT on a STRSXP"
which indicates that it is allowed to do so.

I also suggest to change the error message in line 2648-2649 of src/ 
main/memory.c from
   SET_VECTOR_ELT() can only be applied to a 'list', not a '%s'
to
   SET_VECTOR_ELT() / SET_ELEMENT() can only be applied to a 'list',  
not a '%s'
I guess I ought to have remembered that the two macros are synonymous,  
but I didn't and it took me a while to realize this when I tried to  
fix some code written by another person (who preferred to use  
SET_ELEMENT).

Kasper



[Rd] SET_VECTOR_ELT and STRSXPs
Kasper Daniel Hansen