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

Intercept library/require inside module and display warning #206

Closed
klmr opened this issue May 10, 2021 · 1 comment
Closed

Intercept library/require inside module and display warning #206

klmr opened this issue May 10, 2021 · 1 comment

Comments

@klmr
Copy link
Owner

klmr commented May 10, 2021

See https://twitter.com/_gnoblet/status/1391681125504983041

Today, I did a mistake, used box::use and imported functions I wrote in an R script. I loaded 'magrittr' with library(). But you shouldn't. Always use box with box.

and the reply:

I’m still thinking about a way of hooking the library function inside box, so that such errors don’t happen: it could either raise a warning, or it could silently do “the right thing” (but that’s kind of dangerous …). At the least I’ll write an FAQ.

@klmr
Copy link
Owner Author

klmr commented May 15, 2021

… and what about source/sys.source/…?

@klmr klmr closed this as completed in 12ad580 May 23, 2021
@klmr klmr added the 🙋 FAQ label Jul 4, 2021
radbasa pushed a commit to Appsilon/box that referenced this issue Jul 1, 2024
Legacy functions are functions such as `library`, `require` and
`source` which, when used inside modules, cause undesirable global
behaviour.

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

No branches or pull requests

1 participant