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

Allow for duplicated arguments to call_modify #398

Closed
vspinu opened this issue Jan 27, 2018 · 1 comment
Closed

Allow for duplicated arguments to call_modify #398

vspinu opened this issue Jan 27, 2018 · 1 comment
Labels

Comments

@vspinu
Copy link

@vspinu vspinu commented Jan 27, 2018

Some useful modification patterns are currently disallowed by the arg duplication check:

tc <- quote(foo(a = 1, ..., b = 2))

## move ... towards the end
call_modify(tc, ... = NULL, ... = sym(""))
#> Error: Duplicate arguments

## modification with multiple sources
call_modify(tc, !!!ll(a = 2), !!!ll(a = 3))
#> Error: Duplicate arguments

Judging from the code of call_modify the modification of named args is incremental; so there is probably little reason to disallow duplication.

@lionel- lionel- added the expr:call label Jan 27, 2018
@hadley
Copy link
Member

@hadley hadley commented Oct 1, 2018

I agree we should remove it, and when #340 is implemented, we should make sure that call_modify() can also control it (but default to no error)

lionel- added a commit to lionel-/rlang that referenced this issue Oct 2, 2018
lionel- added a commit to lionel-/rlang that referenced this issue Oct 3, 2018
@lionel- lionel- closed this in #641 Oct 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants