r-lib / rex

Friendly regular expressions for R.
https://rex.r-lib.org
Other
333 stars 27 forks source link

Preserve state of random number generator #92

Closed TimTaylor closed 8 months ago

TimTaylor commented 8 months ago

Per #91 this PR preserves the seed of the random number generator on package attachment.

This does add {withr} as a hard dependency. Whilst I think we could avoid this (maybe setting .Random.seed back on.exit is sufficient), {withr} is lightweight and well tested so I erred towards using it rather than missing something subtle.

kevinushey commented 8 months ago

Thanks!