- Notifications
You must be signed in to change notification settings - Fork417
Fix mistakes in MVar documentation#1087
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
.github/CONTRIBUTING.md Outdated
| ####Write Documentation | ||
| Document any external behavior in the[README](README.md). | ||
| Document any external behavior in the[README](/README.md). |
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.
| Document any external behavior in the[README](/README.md). | |
| Document any external behavior in the[README](../README.md). |
/README.md doesn't seem to work, on GitHub at least, same below of course
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.
Hmm, weird, it did work for me when I viewed CONTRIBUTING.md in the repository.
Fixed.
| # be set to limit the time spent blocked, in which case it returns `TIMEOUT` | ||
| # if the time is exceeded. | ||
| # @return [Object] thetransformed value, or `TIMEOUT` | ||
| # @return [Object] thepre-transform value, or `TIMEOUT` |
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 wonder if instead the code should return the transformed value.
But looking at
concurrent-ruby/spec/concurrent/mvar_spec.rb
Lines 180 to 183 inc8f0bae
| it'returns the unmodified value'do | |
| m=MVar.new(14) | |
| expect(m.modify{ |v|v +2}).toeq14 | |
| end |
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.
Actually, I noticed the problem because the documented behavior seemed weird, as getting previous value would be hard in many cases, and it did not follow the "set and get" pattern.
492a58c toa58b093Comparea58b093 to2c815dbCompare52f0ee4 intoruby-concurrency:masterUh oh!
There was an error while loading.Please reload this page.
Fixes a couple of mistakes in documentation:
#modify's documentationvery incorrectly said that it returns modified value, when that's not the case;#mutateinstead of#modify;Additionally, links to README and CHANGELOG are fixed in contributing guidelines, previously they linked to non-existent files.