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

Change from AutoCloser to Using #715

Merged
merged 6 commits into from
Feb 28, 2023
Merged

Change from AutoCloser to Using #715

merged 6 commits into from
Feb 28, 2023

Conversation

kwalcock
Copy link
Member

No description provided.

@kwalcock
Copy link
Member Author

Neither Scala 2.11 or 2.12 had Using, so the AutoCloser was a local (and now temporary) substitute. For the Scala 2.13 and 3 version of processors, the scala-collection-compat library was needed. Despite Using being unrelated to collections, the library does include a backport of Using. Since that's what will be used in the future, I'd rather not have people getting used to AutoCloser or copying it around to other code when it is no longer necessary. The class remains in case it is used in dependent projects, but processors no longer needs it itself. For Scala 2.11 there still needs to be a hack to be able to close a Source. This is why the import is org.clulab.scala.Using._ instead of scala.utils.Using. If or when the compat library is updated to include Source closing, the import statements can be changed. I filed an issue with them. There's also something similar in fatdynet that needs to be updated.

@MihaiSurdeanu
Copy link
Contributor

This looks nice!
One request: can you please add a documentation page (the project's GH pages?) with the recommended way to access resources in processors (and our lab) based on this?
Thanks!

@kwalcock
Copy link
Member Author

Copy link
Contributor

@MihaiSurdeanu MihaiSurdeanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This was a lot of work... Thanks!

@kwalcock kwalcock merged commit 0160148 into master Feb 28, 2023
@kwalcock kwalcock deleted the kwalcock/using branch February 28, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants