Closed talegari closed 2 years ago
Thanks for your kind words.
However, unfortunately this feature request is at odds with the underlying design of ‘box’.
In case you’re interested in the technical details: the fact that R allows treating variable names and strings interchangeably (in some contexts) is a major flaw that ‘box’ intentionally doesn’t repeat. Strings are logically distinct from names (the former are dynamic, while the latter are a static part of the code). Treating strings and names identically leads to confusing APIs. It’s an anti-pattern that’s an example of stringly typed programming.
In fact, the predecessor of ‘box’ used strings instead of R expressions, and this turned out to be a mistake. Like Python, and unlike Perl, ‘box’ has an opinionated API rather than providing multiple alternatives of doing the same thing.
Please describe your feature request
Firstly, this is a great package and a game changer for R (hoping the community will adopt this on long run).
Request: It would be intuitive to use
box::use("dir/file.R")
as an alternative forbox::use(dir/file.R)
(assumingdir
is in the box path).Extending it, here is the syntax suggestion for others: