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

Correctly modify with NULL values #879

Merged
merged 2 commits into from
Aug 25, 2022
Merged

Correctly modify with NULL values #879

merged 2 commits into from
Aug 25, 2022

Conversation

hadley
Copy link
Member

@hadley hadley commented Aug 25, 2022

Fixes #655. Fixes #746. Fixes #753. Closes #754.

list_assign() from @DavisVaughan. Tests from @vspinu. I chose not to worry about the data frame case, as the existing error is ok.

Fixes #655. Fixes #746. Fixes #753. Closes #754
@hadley hadley requested a review from lionel- August 25, 2022 06:58
R/modify.R Outdated
@@ -473,3 +473,12 @@ inv_which <- function(x, sel) {
stop("unrecognised index type", call. = FALSE)
}
}

`list_assign2<-` <- function(x, i, value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I have never seen an assigner function like this before. Should it be called list_assigner2(), i.e. a noun? With a verb I think I'm expecting a UI like vec_assign().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh it should probably be list_slice2<- actually?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, duh.

@hadley hadley merged commit 8fff9dd into main Aug 25, 2022
@hadley hadley deleted the modify-null branch August 25, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants