Re: [Rd] [External] More precise documentation of on.exit() [when leaving function vs. "context"]

2025-02-14 Thread luke-tierney--- via R-devel
On Fri, 14 Feb 2025, Michael Chirico wrote: The current documentation of ?on.exit reads [1] `on.exit` records [`expr`] as needing to be executed when the current function exits... This is almost always how it is used, however I don't see that as explaining this other common way to use on.ex

[Rd] More precise documentation of on.exit() [when leaving function vs. "context"]

2025-02-14 Thread Michael Chirico
The current documentation of ?on.exit reads [1] > `on.exit` records [`expr`] as needing to be executed when the current > function exits... This is almost always how it is used, however I don't see that as explaining this other common way to use on.exit(): local({ old = setwd(...) on.exit(s