[ruby-core:70641] Re: the undefined behavior of an iterator if it is modified inside of the block to which it yields

From: Nobuyoshi Nakada <nobu@...>
Date: 2015-09-01 01:26:31 UTC
List: ruby-core #70641
On 2015/09/01 1:08, Daniel Doubrovkine wrote:
> I'd like to suggest we change the behavior from "undefined" to "defined" in some future version of Ruby. It seems that in the real world such behavior is very well defined, ie. if you're climbing an escalator and a step appears in front of you before you jump off, you're going to be stepping on it and not having "undefined" behavior :)

Your subject is too big.
Since it's implementation issue, so we could define the behaviors of Array methods, but not other enumerable objects in the world.

In This Thread