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

BUG: The 'where' attribute may pick up the calling environment if global is NULL #79

Closed
HenrikBengtsson opened this issue May 6, 2022 · 2 comments
Labels
Milestone

Comments

@HenrikBengtsson
Copy link
Owner

HenrikBengtsson commented May 6, 2022

From DavisVaughan/furrr#168 (comment):

fn <- function() {
  x <- list(null = NULL, one = 1)
  globals::as.Globals(x)
}

fn()
#> $null
#> NULL
#> 
#> $one
#> [1] 1
#> 
#> attr(,"where")
#> attr(,"where")$null
#> <environment: 0x7fa5ad858e70>
#> 
#> attr(,"where")$one
#> <environment: R_EmptyEnv>
#> 
#> attr(,"class")
#> [1] "Globals" "list"

This is because:

environment(NULL)

returns the calling environment, not NULL, or emptyenv().

/cc @DavisVaughan, oh my. I, either missed that very important troubleshooting of yours, or incorrectly thought it was fixed from quickly skimming the code. So, the "fix" in futureverse/future#475, ended up with the whole thing about dropping where and the emergency back-out future.globals.keepWhere solution, which in turn gives rise to futureverse/future#608. Crossing my finger that fixing this bug here will allow me to withdraw dropping where. It's clear that I have way too much on my plate at times and missing the important details served to me.

@DavisVaughan
Copy link
Contributor

will allow me to withdraw dropping where.

That would be great!

I have way too much on my plate at times

Never feel like you ever have to rush to answer any of my bug reports. I have all the time in the world to wait, and would much rather have you working at your best! It sounds to me like you need to take a break and go paragliding again 😆

@HenrikBengtsson
Copy link
Owner Author

Thanks. Trust me, if the all these storms that been coming in this year would stop for a while, I'd been in the sky right now ... and there's no future up there - only now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants