We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list0()
list0 <- function (...) { mc <- match.call() out <- list() for (i in seq_len(...length())) { tryCatch(out <- append(out, ...elt(i)), error = function(e) { if (!identical(e$message, "argument is missing, with no default")) { e$call <- mc stop(e) } }) } # TODO include this line names(out) <- names(mc)[seq_len(i)][-1] out } fuj::list0(1, 2, 3,) #> [[1]] #> [1] 1 #> #> [[2]] #> [1] 2 #> #> [[3]] #> [1] 3 fuj::list0(a = 1, 2, c = 3,) #> [[1]] #> [1] 1 #> #> [[2]] #> [1] 2 #> #> [[3]] #> [1] 3 list0(1, 2, 3,) #> [[1]] #> [1] 1 #> #> [[2]] #> [1] 2 #> #> [[3]] #> [1] 3 list0(a = 1, 2, c = 3,) #> $a #> [1] 1 #> #> [[2]] #> [1] 2 #> #> $c #> [1] 3
Created on 2023-05-11 with reprex v2.0.2
The text was updated successfully, but these errors were encountered:
#25 include names in list0()
955a9d9
#25 redoc
67d8336
#25 add test
f1219d7
#25 news and version
4d8efc1
jmbarbone
Successfully merging a pull request may close this issue.
Created on 2023-05-11 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: