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
I saw @jennybc 's post about testing with withr and it talked about how defer() in the globalenv is strange. When I thought of defer in globalenv, I immediately though it would just act like reg.finalizer(). Is this not a good idea?
The text was updated successfully, but these errors were encountered:
@hadley actually wondered out loud in the PR whether we should use reg.finalizer() to make sure the deferred global events actually run #76 (review). If you scroll down, you can see the conversation. I actually don't feel like I want that behaviour.
I interpret the fact that this was merged without reg.finalizer() as weak affirmation that my view is OK. But maybe it's not completely settled?
I think both your argument and my argument have merits, but the advantage of guaranteeing clean up on exit are rather mild (since most of the time effects are session specific or in a session-specific temp directory anyway), that using reg.finalizer() would have few additional benefits.
I saw @jennybc 's post about testing with
withr
and it talked about howdefer()
in the globalenv is strange. When I thought of defer in globalenv, I immediately though it would just act likereg.finalizer()
. Is this not a good idea?The text was updated successfully, but these errors were encountered: