NEWS.md

withr (development version)

withr 3.0.0

Performance of withr

Following this change, defer() is now much faster (although still slower than on.exit() which is a primitive function and about as fast as it gets). This also increases the compatibility of defer() with on.exit() (all handlers are now run in the expected order even if they are registered with on.exit()) and standalone versions of defer().

Breaking change

Other features and bugfixes

,* local_tempfile() now writes lines in UTF-8 (#210) and always uses \n for newlines (#216).

withr 2.5.2

withr 2.5.1

withr 2.5.0

When supplied, this restoration pattern is used:

old <- get() on.exit(set(old)) set(new) action()

Instead of:

old <- set(new) on.exit(set(old)) action()

This ensures proper restoration of the old state when an early exit occurs during set() (for instance when a deprecation warning is caught, see #191).

withr 2.4.3

withr 2.4.2

withr 2.4.1

withr 2.4.0

withr 2.3.0

Deprecations

New features

Minor improvements and fixes

withr 2.2.0

withr 2.1.2

withr 2.1.1

withr 2.1.0

withr 2.0.0

withr 1.0.2

withr 1.0.1

withr 1.0.0



r-lib/withr documentation built on Feb. 2, 2024, 2:03 a.m.