Skip to content
Prev 39854 / 398498 Next

Contributing to the R Extensions documentation

On Wed, 2003-11-05 at 12:06, Prof Brian Ripley wrote:
That section discusses reading lists, not making them.

It also includes no explicit statement that the names of list items are
in the R_NamesSymbol attribute, nor instructions on how to create the
value that goes in that attribute (i.e., it should be a character vector
and its elements made with mkChar()).  (I'm also not sure how deep one
needs to use PROTECT, though that's a more general issue.)

There is no explicit statement that the elements of the list are
arbitrary SEXP's.

I also had the list[i] vs list[[i]] lurking in my mind, wondering how
that mapped to the C level constructs.  That is less central.

I'm not saying the clues aren't there; after all, I did work it out, I
think correctly.  I am saying that certain information would be better
stated explicitly rather than simply being open to inference from an
example.  And I am saying that an explicit example of constructing and
returning a list (with named members) would be useful, since that's a
common scenario.