-
Notifications
You must be signed in to change notification settings - Fork 39
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
with_package is detaching the package if it was attached before call #107
Comments
If the package is already attached there isn't much point in using |
Sure, but it could used in a function, and the user doesn't call it directly and doesn't know that it has been called, and then the function would have a mysterious side effect. |
I ran into this issue with a package I'm writing that will allow the user to specify packages to be temporarily loaded when calling Code like that in #138 is a simple workaround, so there's no reason to change the code in
But it might be nice to mention the side effect in the documentation for
|
+1 for only detaching the package if it has been attached by withr. The package description says "Methods For Temporarily Modifying Global State", but |
I believe it's not expected :
reprex :
Created on 2019-06-26 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: