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

Fixed #24: Fixed edge case issue where constraint "> 0" does not hand… #25

Merged
merged 1 commit into from
Nov 29, 2016

Conversation

mattfarina
Copy link
Member

…le "0.0.1-alpha" properly.

@sdboyer
Copy link
Member

sdboyer commented Nov 22, 2016

so when i'd toyed with doing this before, i did something similar, except that i had a uint8 field that i used to express a three-way distinction - zero, infinity, or "normal" version. here, you've just got the two-way distinction. this ends up being important for handling ranges correctly.

as long as this general problem is being dealt with here, perhaps it makes sense to handle all three?

@mattfarina
Copy link
Member Author

@sdboyer I kept this entirely internal on purpose. I expected it will need to change. The reason I didn't handle a 3 way state out of the box (since we've talked about this before) is I couldn't come up with a use case for infinity. I expected it was my own lack of imagination at that time but it meant I couldn't write tests for infinity. Can you share a use case?

@sdboyer
Copy link
Member

sdboyer commented Nov 28, 2016

sure - infinity is the "value" that a range has if it's got no upper bound.

@sdboyer
Copy link
Member

sdboyer commented Nov 28, 2016

to be clear, i'm not sure i'm fully happy with having the three-way distinction, either. i'm gonna have a PR soon (today, i think) against 2.x that has an implementation, though, so we can have a look!

@mattfarina
Copy link
Member Author

@sdboyer I moved the checking logic to the constraint checking rather than the version instances. It seemed cleaner. And, there's no need to store this state.

@mattfarina mattfarina merged commit 85ae12f into master Nov 29, 2016
@mattfarina mattfarina deleted the fix/24 branch November 29, 2016 01:56
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.

2 participants