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

Use a generic Interval or Range class. #3

Closed
seaneagan opened this issue Oct 27, 2014 · 2 comments
Closed

Use a generic Interval or Range class. #3

seaneagan opened this issue Oct 27, 2014 · 2 comments

Comments

@seaneagan
Copy link
Contributor

Instead of a custom VersionRange class, it would be nice to use a generic Interval or Range class. I have a version of Interval here that I'd like to publish as an interval package that could be used. The repo for this package could be kept under the the dart-lang github org.

Then VersionConstraint could have an interval property which returned an Interval<Version>. Then instead of Version implementing VersionConstraint, could have new VersionConstraint.exact(version) whose interval could use Interval.singleton underneath. Then any custom toString() or == would be on VersionConstraint subclasses, and not on the interval itself.

This would of course be a breaking change, but there probably aren't too many consumers of this package yet, just a really big one in pub :).

@seaneagan
Copy link
Contributor Author

Published the interval package.

One wrinkle is that Interval doesn't handle the semantics of VersionRange.allows disallowing pre-releases at the top-end of the range, so that would need to be overridden still.

@nex3
Copy link
Member

nex3 commented Apr 3, 2018

I don't think we'd get enough benefit from this to make the migration worth it, nor does it seem like the interval package is actively maintained anymore.

@nex3 nex3 closed this as completed Apr 3, 2018
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

No branches or pull requests

2 participants