Skip to content

work-in-progress save_rds/read_rds#23

Open
traversc wants to merge 1 commit intoRConsortium:mainfrom
traversc:main
Open

work-in-progress save_rds/read_rds#23
traversc wants to merge 1 commit intoRConsortium:mainfrom
traversc:main

Conversation

@traversc
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread R/registration.R
@@ -0,0 +1,235 @@
.sakura_state <- new.env(parent = emptyenv())
.sakura_serial_fields <- c("class", "package", "sfunc", "ufunc")
.sakura_state$registry <- list()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe we can use hashtab() for this as I expected this might get large eventually when we are successfull with integrating this into base R.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense. I haven't used them before, it looks like it came in with R 4.2 so we may want to switch based on R version.

Comment thread R/registration.R
#' @param package a character string (or vector) naming the package that should
#' be loaded before deserializing objects for each class. May be inferred when
#' `sfunc` and `ufunc` both come from the same package namespace.
#' @param sfunc a function (or list of functions) that accepts a reference
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it does not have to be a reference object, this is just our initial use case I guess.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

R only allows hooks on "reference objects" which are extptr and environments. If we want to expand to more types that would require a base R change.

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