Feature #8506

=begin
Ruby's (({Enumerator}))`Enumerator` and (({#enum_for}))`#enum_for` methods are very powerful and I use them very often. However, (({Object#enum_for}))`Object#enum_for` requires a method that yields, usually in some sort of loop.

Many objects in Ruby have methods that iterate to a "next value," but do not yield. For example, (({Fixnum#next.}))`Fixnum#next.` There is no way to use (({Fixnum#next}))`Fixnum#next` with (({#enum_for}))`#enum_for` directly that I am aware of.

I propose the introduction of (({Object#iter_for}))`Object#iter_for` which--given a method--generates a lazy sequence by continually invoking the method on successive values. I call it (({iter}))`iter` or (({iterate}))`iterate` because it is very similar to clojure's iterate: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/iterate

I am especially excited about (({0.iter_for(:next)}))`0.iter_for(:next)` as I find myself using infinite lazy numeric sequences more often lately to solve specific kinds of problems. Right now you are required to write something like: (({Enumerator.new`Enumerator.new { |y| i = 0; loop { y << i; i += 1 } }}))}` or (({(0..Float::INFINITY).each})).`(0..Float::INFINITY).each`. Neither is especially elegant or happy to the developers' eyes in my opinion.