[Rd] Wrong object type produced - LANGSXP should be LISTSXP (PR#7055)

bauerda at ieee.org bauerda at ieee.org
Tue Jul 6 20:25:07 CEST 2004

Full_Name: David Bauer
Version: 1.9
OS: Linux
Submission from: (NULL) (

In the file gram.y, the xxsubscript function generates a LANGSXP with another
LANGSXP as its CDR.  I believe that this is a mistake and that the second
LANGSXP should be a LISTSXP.  The inputs a1, a3 are parameters to the subscript
function (a2), and as such they should be in a dotted-pair list.

David Bauer

--- gram.y.orig      2003-11-15 05:40:35.000000000 -0500
+++ gram.y        2004-07-06 13:45:10.000000000 -0400
@@ -731,11 +731,11 @@

 static SEXP xxsubscript(SEXP a1, SEXP a2, SEXP a3)
     SEXP ans;
     if (GenerateCode)
-       PROTECT(ans = LCONS(a2, LCONS(a1, CDR(a3))));
+       PROTECT(ans = LCONS(a2, CONS(a1, CDR(a3))));
        PROTECT(ans = R_NilValue);
     return ans;

More information about the R-devel mailing list