https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112015-10-21T12:48:26ZRuby Issue Tracking SystemRuby master - Feature #11498: Kernel#loop: return the "result" value of StopIterationhttps://bugs.ruby-lang.org/issues/11498?journal_id=545052015-10-21T12:48:26Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>I like the idea. If anything bad happens by the patch, I'd love to accept this.</p>
<p>Matz.</p> Ruby master - Feature #11498: Kernel#loop: return the "result" value of StopIterationhttps://bugs.ruby-lang.org/issues/11498?journal_id=545212015-10-22T09:58:26Zknu (Akinori MUSHA)knu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset r52218.</p>
<hr>
<p>Kernel#loop returns the result value of a finished iterator</p>
<ul>
<li>vm_eval.c (rb_f_loop): When a loop is stopped by a StopIteration<br>
exception, return what the enumerator has returned instead of<br>
nil. <a href="/issues/11498">[ruby-core:71133]</a> [Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: Kernel#loop: return the "result" value of StopIteration (Closed)" href="https://bugs.ruby-lang.org/issues/11498">#11498</a>]</li>
</ul>