You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to have an official interface for retrieving names of available options from an environment without evaluating any of those options. Currently we can achieve this by options::opts(NULL, env = myenv) |> names() but after the expected refactoring of #13 it will not be available.
I am thinking of something like this:
#' Get the names of declared options#'#' @inheritParams get_options_env#' @exportopt_names<-function(env= parent.frame(), ..., inherits=TRUE) {
as_env(env) |>
get_options_env(..., inherits=inherits) |>
ls(envir= _, all.names=TRUE, sorted=FALSE)
}
The text was updated successfully, but these errors were encountered:
I'm still debating what the right path will be for this... In an ideal world, you'd be able to do names(opts()), without eagerly evaluating opts() and still returning the values as they existed when you called opts().
I don't think there's going to be a good way to do that without a lot of changes, so in absence of deciding on an ideal path forward, for now I'm going to expose get_options_env() so that you can do names(get_options_env()).
I can't guarantee this will be around forever, but I'll be sure you have a substitute for accessing names, whatever that might look like.
It would be useful to have an official interface for retrieving names of available options from an environment without evaluating any of those options. Currently we can achieve this by
options::opts(NULL, env = myenv) |> names()
but after the expected refactoring of #13 it will not be available.I am thinking of something like this:
The text was updated successfully, but these errors were encountered: