|
|
|
|
|
by pmahoney
392 days ago
|
|
Can you explain further? I'm not sure I follow. > How do you as a method author opt in to distinguishing between [break and next] after yielding to a block? I don't use Ruby much lately, but if I yield to a block which calls break, control will pass to the code following the block (and not back to my method). If the block calls next or simply finishes, control passes back to me though I cannot know if next was called or not (but do I care? I can go ahead and yield the next element of a collection either way) |
|