-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
wordy: test that problems with zero operations give the correct answer #1382
Conversation
The following comment is my current opinion; you might consider averting your eyes if you don't want to be influenced by it: I think we should consider such problems out of scope and leave them as untested (and undefined) behaviour. I just can't convince myself that these should be considered word problems since they're so degenerate. This is despite the fact that I have argued in the commit message that such problems should already be accepted by a reasonably-written implementation and that it helps implementations be more robust. While these statements are true, my understanding of this exercise's scope informs my current thinking on the issue. |
My opinion: the implementation which just strips out everything which is neither a word nor a supported operation is overly simplistic, and shouldn't pass the test suite. The implied syntax of a word problem in regex form is currently Also, while "What is 5" is a degenerate word problem, it's pretty hard to argue that it isn't a word problem. |
I agree, and if this PR is rejected, I have in mind some alternatives that would help with that. Perhaps something like |
I have determined that my opposition to this PR is strength 1/10. Since I have an approval, if no further comments are forthcoming, one should expect me to merge this when 120 hours have passed since the PR was submitted. |
wordy 1.4.0 It's possible to have a healthy debate about whether a problem with zero operations really should count as in scope. One might expect that a generically-written solution would indeed accept such a problem. Consider an implementation that strips away all tokens except for numbers and the four recognised operators (ignoring the intro like "What is"). Such an implementation would now be required to distinguish between the valid "What is 5?" versus the invalid "What is 4 cubed" instead of simply stripping away the "cubed" and declaring the problem invalid because it only contains the single token `4` (for that would also declare `What is 5?` invalid)
} |
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.
whoops
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.
tsk tsk tsk. 😉
It's possible to have a healthy debate about whether a problem with zero
operations really should count as in scope.
One might expect that a generically-written solution would indeed accept
such a problem.
Consider an implementation that strips away all tokens except for
numbers and the four recognised operators (ignoring the intro like "What
is"). Such an implementation would now be required to distinguish
between the valid "What is 5?" versus the invalid "What is 4 cubed"
instead of simply stripping away the "cubed" and declaring the problem
invalid because it only contains the single token
4
(for that wouldalso declare
What is 5?
invalid)Note that this PR intentionally has a merge conflict to prevent accidental merges. The merge conflict is trivially resolvable if it is decided this should be merged, but it should not be resolved unless discussion indicates so.