Skip to content

Keep promises and active bindings in globalenv#521

Merged
renkun-ken merged 6 commits intoREditorSupport:masterfrom
renkun-ken:lazy-inspect-globalenv
Jan 15, 2021
Merged

Keep promises and active bindings in globalenv#521
renkun-ken merged 6 commits intoREditorSupport:masterfrom
renkun-ken:lazy-inspect-globalenv

Conversation

@renkun-ken
Copy link
Copy Markdown
Member

@renkun-ken renkun-ken commented Jan 6, 2021

What problem did you solve?

Close #520

This PR uses rlang::env_binding_are_lazy() and rlang::env_binding_are_active() to know which symbols are promises and active bindings so that they are not forced on task callback to write globalenv info.

(If you have)Screenshot

image

(If you do not have screenshot) How can I check this pull request?

Run the following code in the global environment:

x <- 1
delayedAssign("d", 1)
delayedAssign("err", stop("err"))
makeActiveBinding("a1", function() 1, environment())

No promise or active binding are forced.

Comment thread R/init.R Outdated
Comment thread R/init.R Outdated
Comment thread R/init.R Outdated
Copy link
Copy Markdown
Member

@ManuelHentschel ManuelHentschel left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@renkun-ken renkun-ken merged commit c69cd50 into REditorSupport:master Jan 15, 2021
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.

Should not evaluate delayed-assign object before it gets called

3 participants