Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit binding #355

Open
stefanoborini opened this issue Feb 8, 2024 · 2 comments
Open

Add explicit binding #355

stefanoborini opened this issue Feb 8, 2024 · 2 comments

Comments

@stefanoborini
Copy link

stefanoborini commented Feb 8, 2024

I thought I already filed this, but I cannot find it. Sorry if it's a reiterated request.

The problem we have with box is that the imported symbols are not explicitly bound. This angers linters, that see a symbol appear out of thin air and start complaining.

Example

box::use(mod/hello_world)

hello_world$hello('Ross')

This would trigger a linter problem because hello_world appears from nowhere.

I propose to support the additional syntax

hello_world <- box::use("mod/hello_world")

hello_world$hello('Ross')

This has the added benefit of allowing for easy renaming of the module in case of collision.

@caldwellst
Copy link

caldwellst commented May 29, 2024

Second this, as I have to disable the OBJECT_USAGE_LINTER from {lintr} in codebases using {box} for this reason. However, wondering if support for box::use() syntax could be incorporated into {lintr} to maintain the current syntax, as I think that matches syntax extremely common in Python and many other languages.

@caldwellst
Copy link

r-lib/lintr#2060

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants