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
S7_data<-
names
Note that the name of the 3rd entry is missing after updating.
library(S7) write_once_list <- new_class("write_once_list", class_list, constructor = function(...) new_object(list(...)), validator = function(self) { if(anyDuplicated(nms <- names(self))) paste0("names not all unique. duplicates: ", paste0(unique(nms[duplicated(nms)]), collapse = ", ")) } ) method(`$<-`, write_once_list) <- method(`[[<-`, write_once_list) <- function(x, name, value) { .x <- S7_data(x) if (hasName(.x, name)) stop("entry exists: ", name) .x[[name]] <- value S7_data(x) <- .x x } w <- write_once_list(x = 3, y = 4) w #> <write_once_list> List of 2 #> $ x: num 3 #> $ y: num 4 w$bar <- 1 w #> <write_once_list> List of 3 #> $ x : num 3 #> $ y : num 4 #> $ NA: num 1
The text was updated successfully, but these errors were encountered:
set updated attributes in S7_data<-
02c1e78
closes #478
Successfully merging a pull request may close this issue.
Note that the name of the 3rd entry is missing after updating.
The text was updated successfully, but these errors were encountered: