Project

General

Profile

Misc #11584

Kernel::loop silently catching StopIteration, should be documented

Added by rovf (Ronald Fischer) over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:<unknown>]

Description

The method Kernel::loop implicitly catches a StopIteration exception. This fact is documented on the documentation page for StopIteration, but it should also (and more importantly) be documented with the Kernel::loop method, because if one doesn't know this detail, the behaviour can be pretty surprising - see for example http://stackoverflow.com/questions/33040260/combining-raise-and-throw/.

Updated by nagachika (Tomoyuki Chikanaga) over 4 years ago

  • Status changed from Open to Closed

r52218 added documentation about Kernel#loop and StopIteration.

Also available in: Atom PDF