summaryrefslogtreecommitdiff
path: root/sample/delegate.rb
diff options
context:
space:
mode:
authorIain Barnett <github@strachanclan.xyz>2019-08-17 14:24:45 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 14:24:45 +0900
commitdce1e14e80c9c6d1e25c8aaf9075c80df610ddc3 (patch)
treeab88c32f3c578fdba5230526f1589e5e4a3c5b2c /sample/delegate.rb
parent28267cea083408185de3e0aaafd14ec76c9a3157 (diff)
downloadruby-dce1e14e80c9c6d1e25c8aaf9075c80df610ddc3.tar.gz
Use more different arguments in Fiber.yield documentation to make it clear (#2170)
https://github.com/ruby/ruby/pull/2170#issuecomment-489880700 Documentation is for those who don't know, remember, or understand (to any degree) the language, it should attempt to be clear above all other things. The example given is needlessly unclear because if you use a block it's common for arguments to be reused on every entry to the block. In Fiber's case this is not so. First time round 10 goes in, 12 comes out. Second time round 14 goes in, 14 comes out… was that because 14 is 12 + 2 or because it's "the return value of the call to Fiber.yield". It's the latter because it says so but why does the example need to make anyone think the former? Using different numbers makes it immediately clear what's happening whether the description is there or not.
Diffstat (limited to 'sample/delegate.rb')
0 files changed, 0 insertions, 0 deletions