-
-
Notifications
You must be signed in to change notification settings - Fork 555
all-your-base: Be decisive about zeroes #1001
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
Conversation
all-your-base 2.0.0 In #280 we made the explicit choice to leave various cases `expected: null` where tracks can make their own decisions (leading zeroes, the representations of zero, whether empty sequence is acceptable as input). There are four affected cases. #473 results in a discussion that some post-processing is necessary, based on the decisions that a given track makes. One might even imagine that each individual generator may have to reimplement base translation to arrive at the proper answers for each case. To ease the process of translation, instead we make some canonical choices, explicitly show what the choices are, and offer that tracks may make a different choice if desired. A previous proposal did not receive support: #468 However, this proposal differs because it does change the comments at the top of the file. Closes #1002 by mutual exclusion
"It's up to each track do decide:", | ||
"This canonical data makes the following choices:", | ||
"1. Zero is always represented in outputs as [0] instead of [].", | ||
"2. In no other instances are leading zeroes present in any outputs.", |
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.
this is not really a choice that I expect there to be controversy on, so I guess it is just here to be a foil to choice 1.
"This canonical data makes the following choices:", | ||
"1. Zero is always represented in outputs as [0] instead of [].", | ||
"2. In no other instances are leading zeroes present in any outputs.", | ||
"3. Leading zeroes are accepted in inputs.", |
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.
it should be relatively obvious that the opposite choice is "rejected", so a clause, "rather than being rejected" was not added.
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 like this.
It's good for canonical data to be definite.
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 was writing a generator for it yesterday and didn't like this canonical data since we needed to make choices. This is great!
I think I'll make this 1.2.0 since this commit doesn't introduce any new types that were not already present in this file. That way I can merge this then #1000 and end with version 2.0.0 rather than 3.0.0 or 2.1.0 or something. Not that there's any benefit to being minimal with version changes. |
That means we temporarily restore the "invalids are null" text, only to remove it in #1000
all-your-base 2.0.0
In #280 we made
the explicit choice to leave various cases
expected: null
where trackscan make their own decisions (leading zeroes, the representations of
zero, whether empty sequence is acceptable as input).
There are four affected cases.
#473 results in
a discussion that some post-processing is necessary, based on the
decisions that a given track makes. One might even imagine that each
individual generator may have to reimplement base translation to arrive
at the proper answers for each case.
To ease the process of translation, instead we make some canonical
choices, explicitly show what the choices are, and offer that tracks may
make a different choice if desired.
A previous proposal did not receive support:
#468
However, this proposal differs because it does change the comments at
the top of the file.
Closes #1002 by mutual exclusion