From henr|k@bengt@@on @end|ng |rom gm@||@com  Wed Dec  1 07:10:34 2021
From: henr|k@bengt@@on @end|ng |rom gm@||@com (Henrik Bengtsson)
Date: Tue, 30 Nov 2021 22:10:34 -0800
Subject: [Rd] mapply(): Special case of USE.NAMES=TRUE with recent R-devel
 updates
Message-ID: <CAFDcVCRaGk8b3jeHQq5AL1LQkY1H7GjLRGTcrCPQ9UHye1FTgw@mail.gmail.com>

Hi,

in R-devel (4.2.0), we now get:

> mapply(paste, "A", character(), USE.NAMES = TRUE)
named list()

Now, in ?mapply we have:

USE.NAMES: logical; use the names of the first ... argument, or if
that is an unnamed character vector, use that vector as the names.

This basically says we should get:

> answer <- list()
> first <- "A"
> names(answer) <- first

which obviously is an error. The help is not explicit what should
happen when the length "of the first ... argument" is zero, but the
above behavior effectively does something like:

> answer <- list()
> first <- "A"
> names(answer) <- first[seq_along(answer)]
> answer
named list()

Is there a need for the docs to be updated, or should the result be an
unnamed empty list?

/Henrik



[Rd] mapply(): Special case of USE.NAMES=TRUE with recent R-devel updates
Henrik Bengtsson