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 macros for the scoped borrows in the using step #107

Closed
jmeaster30 opened this issue Mar 15, 2024 · 1 comment
Closed

Add macros for the scoped borrows in the using step #107

jmeaster30 opened this issue Mar 15, 2024 · 1 comment
Labels
Code Style These are changes for style-sake Feature this is something we need to add Macro System change with the macro system Ocean Concerns with the Ocean language

Comments

@jmeaster30
Copy link
Owner

In order to work with the borrow checker properly I had to do a pattern like:

let full_path = {
      let borrow = context.borrow();
      Path::new(&borrow.project_root).join(Path::new(&file_path))
};

and similar for borrow_mut. I will definitely run into issues with this as I move to the other semantic analysis steps so it would be nice to have easy ways to do this and not have ugly blocks everywhere

@jmeaster30 jmeaster30 added Feature this is something we need to add Macro System change with the macro system Code Style These are changes for style-sake Ocean Concerns with the Ocean language labels Mar 15, 2024
@jmeaster30
Copy link
Owner Author

Done and they work well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style These are changes for style-sake Feature this is something we need to add Macro System change with the macro system Ocean Concerns with the Ocean language
Projects
None yet
Development

No branches or pull requests

1 participant