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

list_modify removes elements when replacement is NULL (aka zaps) #810

Closed
vspinu opened this issue Dec 9, 2020 · 0 comments · Fixed by #918
Closed

list_modify removes elements when replacement is NULL (aka zaps) #810

vspinu opened this issue Dec 9, 2020 · 0 comments · Fixed by #918
Labels
feature a feature request or enhancement list 🧦

Comments

@vspinu
Copy link
Member

vspinu commented Dec 9, 2020

Given that zap() is there it doesn't seem reasonable to allow NULLs to remove elements from the list:

> list_modify(list(a = 1, b = 3), b = NULL)
$a
[1] 1

> list_modify(list(a = 1, b = 3), b = zap())
$a
[1] 1

It doesn't seem to be a way to insert NULS into a list with list modify currently.

@hadley hadley added feature a feature request or enhancement list 🧦 labels Aug 24, 2022
hadley added a commit that referenced this issue Sep 6, 2022
* `NULL` now sets value
* Don't recurse into non-lists

Fixes #810
hadley added a commit that referenced this issue Sep 7, 2022
* `NULL` now sets value
* Don't recurse into non-lists

Fixes #810
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement list 🧦
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants