If you tried to delete from a collection while iterating on it Ruby will allow you to do this flawlessly. This generates a wrong output collection after doing this action. An exception should be thrown to disallow this to be done.
I don't think ruby should disallow this via an exception. The use case
seems fairly odd, too - it is often more idiomatic to do .map, .select,
.reject etc...