Skip to content
New issue

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

Fix for duplicate names in list_recurse() #441

Merged
merged 3 commits into from
Feb 8, 2018
Merged

Fix for duplicate names in list_recurse() #441

merged 3 commits into from
Feb 8, 2018

Conversation

mgirlich
Copy link
Contributor

@mgirlich mgirlich commented Jan 8, 2018

Currently, list_modify(), update_list() and list_merge() give wrong results when there are duplicate names in the dots argument, e.g.

list_modify(list(x = 1), x = 2, x = 3)
# actual result
#> $x
#> [1] 2

# expected result
#> $x
#> [1] 3

list_merge(list(x = 1), x = 2, x = 3)
# actual result
#> $x
#> [1] 1 2 2

# expected result
#> $x
#> [1] 1 2 3

In the above example it is of course not very useful. But when splicing with !!! this looks useful to me.
The pull request fixes the underlying function list_recurse() so that it handles duplicate names correctly.

@hadley
Copy link
Member

hadley commented Feb 4, 2018

Can you please add a bullet to NEWS? It should briefly describe the change (starting with name of the function), and crediting yourself with (@yourname, #issuenumber).

@mgirlich
Copy link
Contributor Author

mgirlich commented Feb 7, 2018

I just added the bullet in the NEWS. Is it okay like this?

@hadley hadley merged commit d66b626 into tidyverse:master Feb 8, 2018
@hadley
Copy link
Member

hadley commented Feb 8, 2018

Perfect, thanks!

t-kalinowski pushed a commit to t-kalinowski/purrr that referenced this pull request Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants