[Rd] Feature request: Allow comma after last element in a list

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Fri May 1 19:23:30 CEST 2026


В Fri, 1 May 2026 06:52:13 +0000
Mossa Merhi Reimert via R-devel <r-devel using r-project.org> пишет:

> Honestly, I think R just needs to add these things. I don't know what
> the hold out is. It seems so odd, not to just move on from this lack
> of last-element-comma.

If you want the trailing comma to be ignored in all argument lists,
like in Perl or miniR, that's a breaking change, because it currently
signifies passing a missing argument (see, e.g., alist(,,,)), which is
different from passing no argument at all (see nargs()). This may
matter in methods for `[`, for example.

> `[`(drop=FALSE) should also be adopted.
> 
> Why can't R have these things?

> All CRAN packages can be adjusted to the change, and it would be all
> good.

Experience shows that while some, maybe even most CRAN packages can be
adjusted to a change in R, some of them will end up not being adjusted.
Based on your experience developing miniR, how much breakage on CRAN
and BioConductor do you expect from making drop=FALSE default, compared
to the C API cleanup (which took almost two years to complete and quite
a few sleepless nights to adjust to)? What about the corpus of R code
that's not in the mainstream repositories?

These changes are not unheard of (see news(grepl('stringsAsFactors',
Text))), but the inertia of existing code bases puts a heavy tax on
them.

> CRAN has no package versioning at all.

If by "no package versioning" you mean the CRAN archive not being
available for dependency resolution, consider the implicit
dependencies. A package foo_1.1 that depends on bar (>= 1.5) in 2016
can't predict that bar_3.0 will completely break the API in 2021, or
that its system requirement libbaz will fail to compile using modern
compilers in 2026. In open ecosystems with outside dependencies,
package management will always be a leaky abstraction; there's no
single change that will make dependency resolution on CRAN reliable.

-- 
Best regards,
Ivan



More information about the R-devel mailing list