-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
Implement empty ranges RFC #4280
Conversation
I found an instance of "footgunnery" in the "Examples of Affected Ranges" from the RFC
In actual Pony, this would be |
@rhagenson that footgun was discussed on the RFC and was decided that it wouldn't be address at this time. That was left to a further RFC to sort out. |
I do not doubt it was discussed. Only instance from the list of affected ranges that I have found so far as being not quite the same based on the type parameter used so making the entry in the list misleading. I added tests and will need to note it in the docs that it is a possible tripping point. |
Hi @rhagenson, The changelog - changed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do. Release notes are added by creating a uniquely named file in the The basic format of the release notes (using markdown) should be:
Thanks. |
I believe I have covered everything from the RFC. I added to the original scope only in additional tests and one sentence in the proposed docstring to note the wraparound when using an unsigned type and negative literal. I organized tests by the three classifications (finite, infinite, and empty) as well as removed an unused testing function ( |
.release-notes/4280.md
Outdated
@@ -0,0 +1,5 @@ | |||
## Introduction of empty Ranges | |||
|
|||
Previously, a `Range` was considered infinite if either 1) the step is 0, or any of min, max, or step were NaN, +Inf or -Inf, or 2) if no progress could be made from min to max due to the sign of the step. This classification was a possible source of bugs including "hanging actors" when a `Range` would otherwise be reasonably expected to be **empty** -- producing no values. Through the RFC process the larger Pony community decided of the agreed-upon new mutually exclusive classification for what constitutes finite, infinite, and empty ranges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is important that this came through the RFC process at least as part of the release notes. If you can bring more information about what changed into the release notes, that would be good with perhaps an "additional information available here" type link to the text of the RFC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this paragraph will mean anything to someone who hasn't read the RFC.
I'd like to see a large portion of the motivation section from the RFC written to the past tense and included as the bulk of the release notes to explain why a change was made and then the additional expansion of examples as noted below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a crack at rewriting to keep it short, but increase the amount of "why we made the change" included in the release notes. Take a look when you can and tell me what you think. I was struggling with how to not simply repeat the entire motivation section with all its additional details that would, in my opinion, lead to as much old/outdated code as new/working code without very clear delineation.
@rhagenson can you update the first comment to be the commit comment that should be used when squashing and merging this PR? |
Implement RFC-76: "Introduce Empty Ranges"
This commit additionally adds tests for known footguns. The additional tests are not detailed in the RFC.
Full RFC text is available at https://github.com/ponylang/rfcs/blob/main/text/0076-introduce%20empty%20ranges.md
Closes #4255