klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
833 stars 47 forks source link

Allow excluding attached names via `!` #287

Open klmr opened 1 year ago

klmr commented 1 year ago

Please describe your feature request

Enable the following syntax:

box::use(stats[..., ! filter])

To import and attach all names from the ‘stats’ package, except the name filter. This comes in handy to avoid name conflicts between two attached packages (e.g. stats::filter and dplyr::filter) and makes order of import declarations less important.

Ensure that ! declarations are only valid in conjunction with ... wildcard declarations (since they are otherwise meaningless).